Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDC-1845] QuoteStrategy #372

Merged
merged 37 commits into from
Jun 25, 2012
Merged

Conversation

FabioBatSilva
Copy link
Member

QuoteStrategy

http://www.doctrine-project.org/jira/browse/DDC-1845

This patch fix some quote problems using a default quote strategy and allows users find solutions themselves for weird quote cases.

This DBAL PR shoud be merged to fix sqlite tests in : doctrine/dbal#158

There is a lote of new method calls, the performance tests in sqlite are the following :

My branch :

. testSimpleQueryScalarHydrationPerformance10000Rows - 0.37292098999023 seconds
. testSimpleQueryArrayHydrationPerformance10000Rows - 0.50411009788513 seconds
. testMixedQueryFetchJoinArrayHydrationPerformance10000Rows - 1.1323919296265 seconds
. testSimpleQueryPartialObjectHydrationPerformance10000Rows - 1.0243051052094 seconds
. testSimpleQueryFullObjectHydrationPerformance10000Rows - 4.1673181056976 seconds
. testMixedQueryFetchJoinPartialObjectHydrationPerformance2000Rows - 0.40403699874878 seconds
. testMixedQueryFetchJoinFullObjectHydrationPerformance2000Rows - 0.873291015625 seconds
. 99 CompanyContract: 0.023395
. 99 CompanyContract: 0.019528
. Memory usage before: 111715.53125 KB
. Memory usage after: 110282.875 KB
. Inserted 10000 objects in 5.5240259170532 seconds
. 100 CmsArticle findAll(): 0.018410
. 100 CmsArticle findAll(): 0.014157
. 100 CmsArticle find(): 0.043304
. 100 CmsArticle find(): 0.041451
. 100 CmsGroup: 0.009315
. 100 CmsGroup: 0.009239
. 100 CmsUser: 0.024051
. 100 CmsUser: 0.023655
. Compute ChangeSet 100 objects in 0.040482997894287 seconds

. Time: 19 seconds, Memory: 261.50Mb

Doctrine Master :

. testSimpleQueryScalarHydrationPerformance10000Rows - 0.37668490409851 seconds
. testSimpleQueryArrayHydrationPerformance10000Rows - 0.5009880065918 seconds
. testMixedQueryFetchJoinArrayHydrationPerformance10000Rows - 1.131824016571 seconds
. testSimpleQueryPartialObjectHydrationPerformance10000Rows - 1.037791967392 seconds
. testSimpleQueryFullObjectHydrationPerformance10000Rows - 4.1992859840393 seconds
. testMixedQueryFetchJoinPartialObjectHydrationPerformance2000Rows - 0.41158103942871 seconds
. testMixedQueryFetchJoinFullObjectHydrationPerformance2000Rows - 0.86575293540955 seconds
. 99 CompanyContract: 0.023206
. 99 CompanyContract: 0.020555
. Inserted 10000 objects in 5.4995818138123 seconds
. 100 CmsArticle findAll(): 0.018785
. 100 CmsArticle findAll(): 0.014160
. 100 CmsArticle find(): 0.042067
. 100 CmsArticle find(): 0.041076
. 100 CmsGroup: 0.009478
. 100 CmsGroup: 0.010591
. 100 CmsUser: 0.023727
. 100 CmsUser: 0.023073
. Compute ChangeSet 100 objects in 0.040009021759033 seconds

. Time: 19 seconds, Memory: 260.50Mb

@travisbot
Copy link

This pull request fails (merged c3eaf521 into 7b75849).

public function getQuoteStrategy()
{
if ( ! isset($this->_attributes['quoteStrategy'])) {
$this->_attributes['quoteStrategy'] = new \Doctrine\ORM\Mapping\DefaultQuoteStrategy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add a use statement

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FabioBatSilva you forgot this one ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done ;)

@FabioBatSilva
Copy link
Member Author

DONE !!!

Thanks @stof

@travisbot
Copy link

This pull request fails (merged 80ef4c1e into 7b75849).

@stof
Copy link
Member

stof commented Jun 12, 2012

please fix the code for PostgreSQL and SQLite

if (empty($joinColumn['referencedColumnName'])) {
$joinColumn['referencedColumnName'] = $this->namingStrategy->referenceColumnName();
}

if ($joinColumn['name'][0] == '`') {
$joinColumn['name'] = trim($joinColumn['name'], '`');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is obviously for MySQL: are there other engines using different characters for quoting identifiers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @Ocramius

This is just a doctrine quote token, not used in SQL level

@FabioBatSilva
Copy link
Member Author

Hi @stof

already is fixed.

PostgreSQL fails on cache, even in doctrine/master. not related with my patch.
To fix SQLite doctrine/dbal#158 shoud be merged.

@travisbot
Copy link

This pull request fails (merged 3d4404dc into 7b75849).

@travisbot
Copy link

This pull request fails (merged 0ce06e2b into 27b4f58).

@beberlei
Copy link
Member

+1 from me, @guilhermeblanco whats your take?

$class->getTableName() . '_' . $class->columnNames[$class->identifier[0]] . '_seq' :
null;
$class->setIdGenerator(new \Doctrine\ORM\Id\IdentityGenerator($seqName));
$sequenceName = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing line break between assignment and control structure

@travisbot
Copy link

This pull request fails (merged 039c23ad into 41d9f61).

@travisbot
Copy link

This pull request fails (merged b9d94e7 into 41d9f61).

@FabioBatSilva
Copy link
Member Author

Hi @guilhermeblanco,

Fixed !!
Please take a look again

Thanks

@travisbot
Copy link

This pull request fails (merged 65efda4 into 41d9f61).

@travisbot
Copy link

This pull request fails (merged 7800a7e into 41d9f61).

$class->setIdGenerator(new \Doctrine\ORM\Id\IdentityGenerator($seqName));
$sequenceName = null;

if($this->targetPlatform instanceof Platforms\PostgreSQLPlatform) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between if and open parenthesis

@travisbot
Copy link

This pull request fails (merged ca4862a into 41d9f61).

@FabioBatSilva
Copy link
Member Author

DONE !!!

@Ocramius
Copy link
Member

@FabioBatSilva are the failures now caused by the PR? They're not matching the ones I used to see on PostgreSQL...

@FabioBatSilva
Copy link
Member Author

Hi @Ocramius

PostgreSQL fails on cache, even in doctrine/master. not related with my patch.
To fix SQLite doctrine/dbal#158 shoud be merged.

Thanks .

@Ocramius
Copy link
Member

good to know =)

guilhermeblanco added a commit that referenced this pull request Jun 25, 2012
@guilhermeblanco guilhermeblanco merged commit cb72219 into doctrine:master Jun 25, 2012
@FabioBatSilva FabioBatSilva deleted the DDC-1845 branch January 18, 2013 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants