Hi,
it seems that this is an limitation of the propel used.
The easiest is the following:
If your order by column is unique in the tables you select from:
Check BasePeer 790-800
It looks for a dot in your orderby column. If it cannot find one it sets the
table name to empty.
Then in 819 it is checked if table name is true (empty is false)
Only then the type string check is made.

So if you do not have a dot in your orderby the if will not execute and you
will not get the UPPER function.

If you need to have a dot, then the only thing I could imagine is to change
the column type temporarily:
dbMap->getTable($tableName)->getColumn($columnName)->setType("string2");
or so. 

Propel sometimes needs a hack :(
.: Fabian


-----Original Message-----
From:
[EMAIL PROTECTED]
om
[mailto:[EMAIL PROTECTED]
groups.com] On Behalf Of ts
Sent: Donnerstag, 27. September 2007 14:46
To: symfony developers
Subject: [symfony-devs] MySQL - ORDER BY UPPER(problem)


Hello,

We are using symfony framework in our projects and we found some BUG/
PROBLEM that is a bit confused for us.

Problem is with order by columns that have 'string' type.
We found in sources such lines for building ORDER BY columns with
MySQL DB Adapter

in BasePeer class

00821         if ($column && $column->getType() == 'string') {
00822           $orderByClause[] = $db-
>ignoreCaseInOrderBy("$tableAlias.$columnAlias") . $direction;
00823           $selectClause[] = $db-
>ignoreCaseInOrderBy("$tableAlias.$columnAlias");
00824         }
00825         else {
00826           $orderByClause[] = $orderByColumn;
00827         }

and $db->ignoreCaseInOrderBy() is pointing to

00054     public function ignoreCase($in)
00055     {
00056         return "UPPER(" . $in . ")";
00057     }

in DBMysql class

We are wondering if this is some BUG because we want use ORDER BY
without this UPPER function and have no idea how to make that without
changing that code in core libs.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to