Update to subquery alias.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8564 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-07-05 16:10:36 +00:00
parent e9dca90031
commit 4b85afd9b3
3 changed files with 6 additions and 6 deletions

View file

@ -178,7 +178,8 @@
foreach($this->tables as $table){
if($table->isJoinTable() || !$simple_table_count) $from .= $table->toString($with_values) . ' ';
else $from .= ', '.$table->toString($with_values) . ' ';
if(!$table->isJoinTable()) $from .= $table->getAlias() ? ' as ' . $table->getAlias() . ' ' : ' ';
if(is_a($table, 'Subquery')) $from .= $table->getAlias() ? ' as ' . $table->getAlias() . ' ' : ' ';
$simple_table_count++;
}

View file

@ -10,8 +10,8 @@
}
function toString(){
return $this->name;
//return sprintf("%s%s", $this->name, $this->alias ? ' as ' . $this->alias : '');
//return $this->name;
return sprintf("%s%s", $this->name, $this->alias ? ' as ' . $this->alias : '');
}
function getName(){
@ -23,8 +23,7 @@
}
function isJoinTable(){
if(in_array($tableName,array('left join','left outer join','right join','right outer join'))) return true;
return false;
return false;
}
}

View file

@ -32,7 +32,7 @@
$value = $this->escapeValue($this->value);
return $this->toString($value);
}
function getUnescapedValue(){
return $this->toString($this->value);
}