DBD-Wire10
view release on metacpan or search on metacpan
lib/DBD/Wire10.pm view on Meta::CPAN
# (The server happily accepts, discards and prints a catalog named
# 'def', though.)
return 0 if $type == 114;
# Return undef for unknown and unsupported attributes.
return undef;
}
sub take_imp_data {
my $dbh = shift;
# Finish any active statements (important if streaming enabled).
for my $sth (@{$dbh->{ChildHandles} || []}) {
next unless $sth;
$sth->finish if $sth->{Active};
}
# Take out core driver and remove reference to it.
my $wire = $dbh->FETCH('wire10_driver_dbh');
$dbh->STORE('wire10_driver_dbh', undef);
# Remove reference to dbh from drh, probably also destroys dbh.
lib/DBD/Wire10.pm view on Meta::CPAN
if (scalar(@new_params) > 0) {
$ps->clear_parameter;
my $i = 1;
foreach my $p (@new_params) {
$ps->set_parameter($i++, $p, 0);
}
}
my $rowcount = eval {
$sth->finish;
my $stream_results = $sth->FETCH('wire10_streaming') || 0;
my $res = $stream_results ? $ps->stream : $ps->query;
die if $wire->get_error_info;
$sth->STORE('wire10_warning_count', $res->get_warning_count);
# For backward compatibility and/or do(), store in dbh too.
my $dbh = $sth->{Database};
$dbh->STORE('wire10_warning_count', $res->get_warning_count);
if ($res->has_results) {
lib/DBD/Wire10.pm view on Meta::CPAN
$sth->DBI::set_err(-1, $@);
return undef;
}
return 1;
}
sub finish {
my $sth = shift;
my $dbh = $sth->{Database};
# If in streaming mode, flush remaining results.
my $iterator = $sth->{wire10_iterator};
$iterator->spool if defined $iterator;
$sth->{wire10_iterator} = undef;
$sth->STORE('Active', 0);
$sth->SUPER::finish;
}
sub fetchrow_arrayref {
my $sth = shift;
lib/DBD/Wire10.pm view on Meta::CPAN
The number of affected rows after an UPDATE or similar query, or the number of rows so far read by the client during a SELECT or similar query.
=head3 I<Statement>: attributes
=head4 wire10_insertid
Contains the auto_increment value for the last row inserted.
my $id = $sth->{wire10_insertid};
=head4 wire10_streaming
If this is set to 1 (or any value that evaluates to true), results will be streamed from the server rather than downloaded all at once, when the statement is executed.
$sth->{wire10_streaming} = 1;
Notice that the underlying protocol has a limitation: when a streaming statement is active, no other statements can execute on the same connection.
=head4 wire10_warning_count
Contains the number of warnings produced by the last query.
my $warnings = $sth->{wire10_warning_count};
=head4 ChopBlanks
If enabled, runs every field value in result sets through a regular expression that trims for whitespace.
lib/DBD/Wire10.pm view on Meta::CPAN
Various connection methods and other protocol features are not supported by the underlying driver. See the "Unsupported features" chapter in the L<Net::Wire10> documentation for more information.
=head3 Supported DBI methods and attributes
Some methods are not yet supported in this driver, in particular type_info_all, table_info, column_info, primary_key_info and foreign_key_info. Some attributes are not yet supported, in particular TYPE.
=head3 Supported C<mysql_> attributes
All of the C<mysql_> attributes are unavailable. DBI requires that each driver uses a unique prefix, therefore this driver supports only attributes named C<wire10_>.
Not all C<mysql_> attributes have equivalently named C<wire10_> attributes. For example, there is no C<mysql_use_result> attribute, but one called C<wire10_streaming> does exactly the same.
=head2 Dependencies
This module requires these other modules and libraries:
L<DBI::DBI>
L<Net::Wire10>
B<Net::Wire10> is a Pure Perl connector for MySQL, Sphinx and Drizzle servers.
( run in 0.224 second using v1.01-cache-2.11-cpan-4d50c553e7e )