fix a DboDataSource buildJoinStatement bug that table prefix is appended to subquery #1103

merged 2 commits into from Feb 1, 2013


None yet

3 participants


when table is a subquery string, it is not necessary at all to call fullTableName, this will avoid both schema and table prefix appended to it

fix ticket #3579

@markstory markstory and 2 others commented on an outdated diff Jan 31, 2013
@@ -1691,9 +1691,8 @@ public function buildJoinStatement($join) {
if (!empty($data['conditions'])) {
$data['conditions'] = trim($this->conditions($data['conditions'], true, false));
- if (!empty($data['table'])) {
- $schema = !(is_string($data['table']) && strpos($data['table'], '(') === 0);
- $data['table'] = $this->fullTableName($data['table'], true, $schema);
+ if (!empty($data['table']) && (!is_string($data['table']) || strpos($data['table'], '(') !== 0)){
+ $data['table'] = $this->fullTableName($data['table']);
markstory Jan 31, 2013 CakePHP member

Where did the 2 other arguments go?

perrywky Feb 1, 2013

I think the other 2 arguments is not necessary, the default value is true, and we do not need to change it.

rchavik Feb 1, 2013 CakePHP member

minor nitpick, there should be a space before { in )){ in line 1694

CakePHP member

Other than the question I had, this change looks good to me.

@markstory markstory merged commit e0ce0ac into cakephp:master Feb 1, 2013
CakePHP member

no squash? :(

no matter.

CakePHP member

Too lazy, github merge button was easier. It was only 1 funky commit so I didn't think it was a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment