SQL Reports were broken in non-mysql
This commit is contained in:
parent
f170f246c6
commit
37367a6c9f
3 changed files with 22 additions and 4 deletions
|
|
@ -10,6 +10,7 @@
|
|||
- Collaboration systems should always tell browser there is new content
|
||||
- fix: Good Bad fields not properly localized
|
||||
- fix: File user profile fields didn't link to the file
|
||||
- fix: SQL Reports only work on MySQL databases
|
||||
|
||||
7.4.8
|
||||
- fix: Syndicated Content doesn't display all items with multiple feeds in interleaved mode
|
||||
|
|
|
|||
|
|
@ -266,6 +266,23 @@ sub get {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getDriver ( )
|
||||
|
||||
Returns the DBI driver used by this database link
|
||||
|
||||
=cut
|
||||
|
||||
sub getDriver {
|
||||
my $self = shift;
|
||||
my $dsn = $self->get->{DNS};
|
||||
if ($dsn =~ /^dbi:(\w+):/i) {
|
||||
return $1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getId ( )
|
||||
|
||||
Returns the ID of this database link.
|
||||
|
|
|
|||
|
|
@ -680,12 +680,12 @@ sub setDataByQuery {
|
|||
my $pageNumber = $self->getPageNumber;
|
||||
my $rowsPerPage = $self->{_rpp};
|
||||
|
||||
#Handle dynamicPageNumber requests or custom limts the old way as it winds up being most efficient
|
||||
if ((defined $dynamicPageNumberKey && $pageNumber == 1) || $sql =~ m/limit/i) {
|
||||
$dbh ||= $self->session->dbSlave;
|
||||
|
||||
#Handle dynamicPageNumber requests or custom limits, or non-mysql the old way as it winds up being most efficient
|
||||
if ($dbh->getDriver ne 'mysql' || (defined $dynamicPageNumberKey && $pageNumber == 1) || $sql =~ m/limit/i) {
|
||||
return $self->_setDataByQuery(@_);
|
||||
}
|
||||
|
||||
$dbh ||= $self->session->dbSlave;
|
||||
|
||||
#Calculate where to start
|
||||
my $start = ( ($pageNumber - 1) * $rowsPerPage );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue