diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-12-17 19:28:26 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-17 19:28:26 +0000 |
| commit | fe396410894f9fcf430e31216312f70db800d96e (patch) | |
| tree | fc1222c074e0f8ffd2d952688353f5bf79e360f5 /kohana/libraries/Database.php | |
| parent | 093fb407a839b1bdacd0cd6036b349a42dcfea7d (diff) | |
Update Kohana code to r3799 from their svn head. All tests pass.
Resolved upstream tickets:
http://dev.kohanaphp.com/ticket/972
Command:
svn merge -c19275 vendor/kohana/modified/kohana trunk/kohana
Diffstat (limited to 'kohana/libraries/Database.php')
| -rw-r--r-- | kohana/libraries/Database.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kohana/libraries/Database.php b/kohana/libraries/Database.php index ca4f6512..fd1ae3fa 100644 --- a/kohana/libraries/Database.php +++ b/kohana/libraries/Database.php @@ -621,6 +621,12 @@ class Database_Core { if ($val != '') { + // Add the table prefix if we are using table.column names + if(strpos($val, '.')) + { + $val = $this->config['table_prefix'].$val; + } + $this->groupby[] = $this->driver->escape_column($val); } } @@ -674,11 +680,18 @@ class Database_Core { { $direction = strtoupper(trim($direction)); + // Add a direction if the provided one isn't valid if ( ! in_array($direction, array('ASC', 'DESC', 'RAND()', 'RANDOM()', 'NULL'))) { $direction = 'ASC'; } + // Add the table prefix if a table.column was passed + if (strpos($column, '.')) + { + $column = $this->config['table_prefix'].$column; + } + $this->orderby[] = $this->driver->escape_column($column).' '.$direction; } |
