view release on metacpan or search on metacpan
##
# Number of attributes
#
sub attributes_number ($)
{ my $self=shift;
ag_db_stat($$self,-1,-1);
}
##
# Number of values
#
sub values_number($%)
{ my $self=shift;
my $args=get_args(\@_);
my $attr=$args->{attribute} || $args->{attr} || 0;
ag_db_stat($$self,$attr,-1);
}
##
# Length of field
#
sub value_length ($%)
{ my $self=shift;
my $args=get_args(\@_);
my $attr=$args->{attribute} || $args->{attr} || 0;
my $value=$args->{value} || $args->{val} || 0;
ag_db_stat($$self,$attr,$value);
}
##
# Deletes value
#
order locking it if required. Returns key text or undef if no more
records exist.
=head1 FIELD LEVEL METHODS
=head2 ag_db_stat($db, $attr, $value);
This method determines the size and composition of a field in the
I<current record>. Consult appgen documentation for details.
A number of methods exists to get the same functionality in more
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DB/Object.pm view on Meta::CPAN
my $sth = $repo->{sth} || return( '' );
# A DB::Object::Statement object
my $qo = $sth->query_object;
return( '' ) if( !CORE::length( $def->{file} ) );
return( '' ) if( !-e( $def->{file} ) );
return( '' ) if( ( CORE::stat( $def->{file} ) )[9] != $ts );
return( $self->error( "Query object retrieved from constant query cache is void!" ) ) if( !$qo );
return( $self->error( "Query object retrieved from constant query cache is not a DB::Object::Query object or one of its sub classes." ) ) if( !$self->_is_object( $qo ) || !$qo->isa( 'DB::Object::Query' ) );
return if( $self->database ne $qo->database_object->database );
return( $sth );
lib/DB/Object.pm view on Meta::CPAN
!$def->{query_object}->isa( 'DB::Object::Query' ) )
{
return( $self->error( "Provided query object is not a DB::Object::Query." ) );
}
$def->{ts} = [CORE::stat( $def->{file} )]->[9];
my $cache_key = CORE::join( '|', @$def{qw( pack file line )} );
my $serialiser = CORE::delete( $def->{serialiser} ) || $DB::Object::SERIALISER || 'Storable';
my $repo = Module::Generic::Global->new( queries_cache => $base_class,
view all matches for this distribution
view release on metacpan or search on metacpan
c/speedyb.c view on Meta::CPAN
bzero(dbh, sizeof(dbh_t));
if((dbh->fd = open(fn, O_RDONLY)) < 0) {
ERETURN(SPEEDYB_EOPEN);
}
if(stat(fn, &statbuf)) {
ERETURN(SPEEDYB_EOPEN);
}
if(MAP_FAILED == (db = mmap(NULL, statbuf.st_size, PROT_READ, MAP_SHARED, dbh->fd, 0))) {
ERETURN(SPEEDYB_EOPEN);
}
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
else {
$opts{INC} = "-I. -I$incdir $opts{INC}";
$libname =~ s/^lib//;
$libname =~ s/\.a|\.so&//;
$opts{LIBS} = " -L$libdir -l$libname -lm";
# Because unable to resolve stat()
if ($^O eq "linux") {
$opts{LIBS} = $opts{LIBS}." -lc";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
Illustra.xs view on Meta::CPAN
do_error(dbh,0,"Error opening large object");
XSRETURN_UNDEF;
}
/* Stat large object to get size */
if((st=mi_large_object_stat(imp_dbh->conn,lodesc))==NULL){
do_error(dbh,0,"Error stat\'ing large object");
mi_large_object_close(imp_dbh->conn,lodesc);
XSRETURN_UNDEF;
}
losize=st->mist_size;
view all matches for this distribution
view release on metacpan or search on metacpan
EXEC SQL GET DESCRIPTOR :nm_obind VALUE :index
:bclob = DATA;
LO_fd = ifx_lo_open(&bclob, LO_RDONLY, &error);
if (LO_fd == -1)
croak("Error opening %cLOB: %d", cb, error);
if (ifx_lo_stat(LO_fd, &LO_stat) < 0)
croak("Error getting %cLOB stat", cb);
if (ifx_lo_stat_size(LO_stat, &size) != 0)
croak("Error getting %cLOB size", cb);
if (ifx_int8tolong(&size, &bloblen) != 0)
croak("Error converting %cLOB size to length", cb);
view all matches for this distribution
view release on metacpan or search on metacpan
$sth->{pg_prepare_name} = 'mystat';
$sth->execute(123);
The above will run the equivalent of this query on the backend:
EXECUTE mystat(123);
which is the equivalent of:
SELECT COUNT(*) FROM pg_class WHERE reltuples < 123;
view all matches for this distribution
view release on metacpan or search on metacpan
result = sv_2mortal(newSViv(PTR2IV(imp_dbh->pmysql)));
else if (memEQs(key, kl, "mariadb_sockfd"))
result = (imp_dbh->sock_fd >= 0) ? sv_2mortal(newSViv(imp_dbh->sock_fd)) : &PL_sv_undef;
else if (memEQs(key, kl, "mariadb_stat"))
{
const char *stats = imp_dbh->pmysql ? mysql_stat(imp_dbh->pmysql) : NULL;
result = stats ? sv_2mortal(newSVpv(stats, 0)) : &PL_sv_undef;
sv_utf8_decode(result);
}
else if (memEQs(key, kl, "mariadb_server_prepare"))
result = boolSV(imp_dbh->use_server_side_prepare);
view all matches for this distribution