mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
applied a patch from VOVKASM (#79576)
This commit is contained in:
parent
e2ecdff4a2
commit
b1d1047321
2 changed files with 12 additions and 2 deletions
2
dbdimp.c
2
dbdimp.c
|
@ -1197,7 +1197,7 @@ sqlite_bind_ph(SV *sth, imp_sth_t *imp_sth,
|
||||||
pos = 2 * (SvIV(param) - 1);
|
pos = 2 * (SvIV(param) - 1);
|
||||||
}
|
}
|
||||||
sqlite_trace(sth, imp_sth, 3, form("bind into 0x%p: %"IVdf" => %s (%"IVdf") pos %d", imp_sth->params, SvIV(param), SvPV_nolen_undef_ok(value), sql_type, pos));
|
sqlite_trace(sth, imp_sth, 3, form("bind into 0x%p: %"IVdf" => %s (%"IVdf") pos %d", imp_sth->params, SvIV(param), SvPV_nolen_undef_ok(value), sql_type, pos));
|
||||||
av_store(imp_sth->params, pos, SvREFCNT_inc(value));
|
av_store(imp_sth->params, pos, newSVsv(value));
|
||||||
if (sql_type) {
|
if (sql_type) {
|
||||||
av_store(imp_sth->params, pos+1, newSViv(sql_type));
|
av_store(imp_sth->params, pos+1, newSViv(sql_type));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ BEGIN {
|
||||||
}
|
}
|
||||||
|
|
||||||
use t::lib::Test;
|
use t::lib::Test;
|
||||||
use Test::More tests => 33;
|
use Test::More tests => 39;
|
||||||
use Test::NoWarnings;
|
use Test::NoWarnings;
|
||||||
use DBI ':sql_types';
|
use DBI ':sql_types';
|
||||||
|
|
||||||
|
@ -48,6 +48,13 @@ SCOPE: {
|
||||||
ok( $sth->bind_param(1, 5, SQL_INTEGER), 'bind 3' );
|
ok( $sth->bind_param(1, 5, SQL_INTEGER), 'bind 3' );
|
||||||
ok( $sth->bind_param(2, undef), 'bind 4' );
|
ok( $sth->bind_param(2, undef), 'bind 4' );
|
||||||
ok( $sth->execute, '->execute' );
|
ok( $sth->execute, '->execute' );
|
||||||
|
|
||||||
|
# Works with PADTMPs?
|
||||||
|
my @values = (6, "Larry");
|
||||||
|
for (my $i=0; $i<2; $i++) {
|
||||||
|
ok( $sth->bind_param($i+1, "$values[$i]"), 'bind '.($i+5) );
|
||||||
|
}
|
||||||
|
ok( $sth->execute, '->execute' );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reconnect
|
# Reconnect
|
||||||
|
@ -75,4 +82,7 @@ SCOPE: {
|
||||||
ok( $sth->fetch, '->fetch' );
|
ok( $sth->fetch, '->fetch' );
|
||||||
is( $id, 5, 'id = 5' );
|
is( $id, 5, 'id = 5' );
|
||||||
is( $name, undef, 'name = undef' );
|
is( $name, undef, 'name = undef' );
|
||||||
|
ok( $sth->fetch, '->fetch' );
|
||||||
|
is( $id, 6, 'id = 6' );
|
||||||
|
is( $name, 'Larry', 'name = Larry' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue