1 |
efrain |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Oracle 8.0.5 (oci8) driver
|
|
|
4 |
*
|
|
|
5 |
* @deprecated
|
|
|
6 |
*
|
|
|
7 |
* Optimizes selectLimit() performance with FIRST_ROWS hint.
|
|
|
8 |
*
|
|
|
9 |
* This file is part of ADOdb, a Database Abstraction Layer library for PHP.
|
|
|
10 |
*
|
|
|
11 |
* @package ADOdb
|
|
|
12 |
* @link https://adodb.org Project's web site and documentation
|
|
|
13 |
* @link https://github.com/ADOdb/ADOdb Source code and issue tracker
|
|
|
14 |
*
|
|
|
15 |
* The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
|
|
|
16 |
* and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
|
|
|
17 |
* any later version. This means you can use it in proprietary products.
|
|
|
18 |
* See the LICENSE.md file distributed with this source code for details.
|
|
|
19 |
* @license BSD-3-Clause
|
|
|
20 |
* @license LGPL-2.1-or-later
|
|
|
21 |
*
|
|
|
22 |
* @copyright 2000-2013 John Lim
|
|
|
23 |
* @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
// security - hide paths
|
|
|
27 |
if (!defined('ADODB_DIR')) die();
|
|
|
28 |
|
|
|
29 |
include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
|
|
|
30 |
|
|
|
31 |
class ADODB_oci805 extends ADODB_oci8 {
|
|
|
32 |
var $databaseType = "oci805";
|
|
|
33 |
var $connectSID = true;
|
|
|
34 |
|
|
|
35 |
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
|
|
36 |
{
|
|
|
37 |
// seems that oracle only supports 1 hint comment in 8i
|
|
|
38 |
if (strpos($sql,'/*+') !== false)
|
|
|
39 |
$sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql);
|
|
|
40 |
else
|
|
|
41 |
$sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql);
|
|
|
42 |
|
|
|
43 |
/*
|
|
|
44 |
The following is only available from 8.1.5 because order by in inline views not
|
|
|
45 |
available before then...
|
|
|
46 |
http://www.jlcomp.demon.co.uk/faq/top_sql.html
|
|
|
47 |
if ($nrows > 0) {
|
|
|
48 |
if ($offset > 0) $nrows += $offset;
|
|
|
49 |
$sql = "select * from ($sql) where rownum <= $nrows";
|
|
|
50 |
$nrows = -1;
|
|
|
51 |
}
|
|
|
52 |
*/
|
|
|
53 |
|
|
|
54 |
return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
|
|
|
55 |
}
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
class ADORecordset_oci805 extends ADORecordset_oci8 {
|
|
|
59 |
var $databaseType = "oci805";
|
|
|
60 |
}
|