[Solar-svn] Revision 2947
pmjones at solarphp.com
pmjones at solarphp.com
Thu Nov 15 07:23:49 CST 2007
Solar_Sql_Model_Related, Related_HasMany: [CHG] Now uses the adapter-specific disambiguate() when adding the native_alias.native_col in the has-many eager fethcing sub-select.
Modified: trunk/Solar/Sql/Model/Related/HasMany.php
===================================================================
--- trunk/Solar/Sql/Model/Related/HasMany.php 2007-11-15 13:21:26 UTC (rev 2946)
+++ trunk/Solar/Sql/Model/Related/HasMany.php 2007-11-15 13:23:49 UTC (rev 2947)
@@ -215,7 +215,9 @@
// this also helps SQLite, which is picky about fully-qualified
// names in sub-selects.
$clone->clear('cols');
- $clone->cols($this->native_col);
+ $disambig_col = $clone->disambiguate($this->native_alias, $this->native_col);
+ $clone->cols($disambig_col);
+
$inner = str_replace("\n", "\n\t\t", $clone->fetchSql());
// add the native table ID at the top through a join
@@ -240,4 +242,4 @@
);
}
}
-}
\ No newline at end of file
+}
Modified: trunk/Solar/Sql/Model/Related.php
===================================================================
--- trunk/Solar/Sql/Model/Related.php 2007-11-15 13:21:26 UTC (rev 2946)
+++ trunk/Solar/Sql/Model/Related.php 2007-11-15 13:23:49 UTC (rev 2947)
@@ -474,10 +474,10 @@
// sub-select **only** the native column, so that we're not
// pulling back everything, just the part we need to join on.
- // this also helps SQLite, which is picky about fully-qualified
- // names in sub-selects.
$clone->clear('cols');
- $clone->cols($this->native_col);
+ $disambig_col = $clone->disambiguate($this->native_alias, $this->native_col);
+ $clone->cols($disambig_col);
+
$inner = str_replace("\n", "\n\t\t", $clone->fetchSql());
// add the native table ID at the top through a join
@@ -715,4 +715,4 @@
*
*/
abstract protected function _setRelated($opts);
-}
\ No newline at end of file
+}
More information about the Solar-svn
mailing list