mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-08 21:12:12 +09:00
Added unit tests for correlated subqueries - select, from, where.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8556 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5d1eb1c21e
commit
1353ade0c2
41 changed files with 661 additions and 256 deletions
|
|
@ -13,13 +13,21 @@
|
|||
require_once(_XE_PATH_.'classes/xml/xmlquery/QueryParser.class.php');
|
||||
|
||||
class XmlQueryParser extends XmlParser {
|
||||
var $dbParser;
|
||||
static $dbParser = null;
|
||||
var $db_type;
|
||||
|
||||
function XmlQueryParser($db_type = NULL){
|
||||
$this->db_type = $db_type;
|
||||
}
|
||||
|
||||
function &getInstance($db_type = NULL){
|
||||
static $theInstance = null;
|
||||
if(!isset($theInstance)){
|
||||
$theInstance = new XmlQueryParser($db_type);
|
||||
}
|
||||
return $theInstance;
|
||||
}
|
||||
|
||||
function parse($query_id, $xml_file, $cache_file) {
|
||||
|
||||
// Read xml file
|
||||
|
|
@ -36,15 +44,19 @@
|
|||
|
||||
// singleton
|
||||
function &getDBParser(){
|
||||
static $dbParser;
|
||||
if(!$dbParser){
|
||||
if(isset($this->db_type))
|
||||
$oDB = &DB::getInstance($this->db_type);
|
||||
if(!$self->dbParser){
|
||||
is_a($this,'XmlQueryParser')?$self=&$this:$self=&XmlQueryParser::getInstance();
|
||||
if(isset($self->db_type))
|
||||
$oDB = &DB::getInstance($self->db_type);
|
||||
else
|
||||
$oDB = &DB::getInstance();
|
||||
$dbParser = $oDB->getParser();
|
||||
$self->dbParser = $oDB->getParser();
|
||||
}
|
||||
return $dbParser;
|
||||
return $self->dbParser;
|
||||
}
|
||||
|
||||
function setDBParser($value){
|
||||
$self->dbParser = $value;
|
||||
}
|
||||
|
||||
function getXmlFileContent($xml_file){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue