Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
perl5
/
vendor_perl
/
DBM
/
Deep
/
Iterator
Upload
5 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
DBI.pm
767 B
-rw-r--r--
2019-10-16 10:59:24
Edit
Del
File
-
drwxr-xr-x
2022-02-23 11:31:33
Del
File.pm
2.66 KB
-rw-r--r--
2019-10-16 10:59:24
Edit
Del
Editing: DBI.pm
(767 B)
Path: /usr/share/perl5/vendor_perl/DBM/Deep/Iterator/DBI.pm
Back
package DBM::Deep::Iterator::DBI; use strict; use warnings FATAL => 'all'; use base qw( DBM::Deep::Iterator ); sub reset { my $self = shift; eval { $self->{sth}->finish; }; delete $self->{sth}; return; } sub get_next_key { my $self = shift; my ($obj) = @_; unless ( exists $self->{sth} ) { # For mysql, this needs to be RAND() # For sqlite, this needs to be random() my $storage = $self->{engine}->storage; $self->{sth} = $storage->{dbh}->prepare( "SELECT `key` FROM datas WHERE ref_id = ? ORDER BY " . $storage->rand_function, ); $self->{sth}->execute( $self->{base_offset} ); } my ($key) = $self->{sth}->fetchrow_array; return $key; } 1; __END__