[DC-946] Oracle Doctrine_RawSql()->count() generates illegal SQL Created: 08/Dec/10 Updated: 06/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lars Pohlmann | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | oracle | ||
| Description |
|
Example RawSQL: $q = new Doctrine_RawSql(); $q->select('{k.*}') ->from('SHP_MANDANT_KATEGORIE k') ->addComponent('k', 'ShpMandantKategorie k') ->where( 'k.id_mandant=' . $this->getIdMandant() ) ->andWhere( 'k.id_parent=' . $this->getIdMandantkategorie() ) ->andWhere( 'k.aktiv=1' ) ->orderBy( 'k.sortorder' ); $q->count() generates: SELECT COUNT(*) as num_results FROM (SELECT DISTINCT k.id_mandantkategorie FROM SHP_MANDANT_KATEGORIE k WHERE k.id_mandant=2 AND k.id_parent=1520 AND k.aktiv=1) as results The illegal Part ist the "as results" at the end... |
| Comments |
| Comment by Lars Pohlmann [ 06/Aug/12 ] |
|
Hi, will this ever be corrected? |
[DC-852] CLONE -Fix returned type value : SQL integers to PHP integers when getting a value from the database. Created: 01/Sep/10 Updated: 02/Sep/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Attributes, Data Fixtures, Native SQL, Query, Record |
| Affects Version/s: | 1.2.3 |
| Fix Version/s: | 1.2.4 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Enrico Stahn | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Hi Jon, I have a request for you to improve Doctrine. When declaring a column as an integer, it seems that Doctrine returns a string when getting the value of that column. For example, if I have a "status" column, which can take 0, 1 or 2 as its value, Doctrine will return these values as string, which is not really logical and returning the good PHP type is the goal of an ORM. I'm fond of the triple equal symbol to test a value and I did not understand why this did not work at start : // in my myModel class public function isValidated() { return self::STATUS_VALIDATED === $this->getStatus(); }} That's why getStatus() gives me a string instead of an integer, whereas the column is declared as an integer in my schema. I'm forced to cast myself the returned value of getStatus() in my model. |
| Comments |
| Comment by Enrico Stahn [ 01/Sep/10 ] |
|
Proposal for a solution: http://github.com/estahn/doctrine1/compare/master...DC-852 |
| Comment by Jonathan H. Wage [ 01/Sep/10 ] |
|
So if you enable this attribute you live with the fact that casting a string to an integer that is longer than php max integer will give weird results? |
| Comment by Enrico Stahn [ 02/Sep/10 ] |
|
i'm far from happy with this solution. if an integer that is greater than php max int gets casted it will be casted into a value of type double. if you enable that attribute only values that could successfully casted into an integer will be casted otherwise an exception will be thrown. |
[DC-781] Column order in generated SQL is based on relationships, instead of SELECT clause Created: 10/Jul/10 Updated: 10/Jul/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Prasad Gupte | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows / PHP 5.2.4 / MySQL 5.1.41 / Symfony 1.4.0 |
||
| Description |
|
When executing below query as follows: SQL generated is: Basically, columns are ordered based on relationships and not as defined in the SELECT clause |
[DC-752] Data type "decimal" can be unsigned in MySQL 5.0 Created: 18/Jun/10 Updated: 18/Jun/10 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Native SQL, Schema Files |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Ilya Sabelnikov | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS: FreeBSD 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 amd64 |
||
| Description |
|
I have found in official docs of MySQL v5.0: Decimals can be unsigned: DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL] Here above is my "schema.yml" file: schema.yml
Project:
columns:
id:
type: integer(4)
unsigned: true
primary: true
autoincrement: true
salary_range_from:
type: decimal(12)
scale: 2
unsigned: true
After i run: ./symfony doctrine:build --all my "schema.sql" is: schema.sql CREATE TABLE `project` ( `id` INT AUTO_INCREMENT, `salary_range_from` DECIMAL(12, 2), INDEX `company_id_idx` (`company_id`), PRIMARY KEY(`id`) ) DEFAULT CHARACTER SET utf8 ENGINE = INNODB; |