Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpFoundation] changed MERGE queries#18501

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.7fromhjkl:ticket_17284
Jun 19, 2016
Merged

Conversation

@hjkl
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#17284
LicenseMIT
Doc PRN/A

Changed the MERGE queries for Oracle and SQL Server to use question mark parameter markers so they work with emulation disabled or enabled -fixes#17284

@xabbuh
Copy link
Member

Imo a proper fix would rather change the queries to not use a named parameter more than once.

@slootjes
Copy link

I can confirm this fix is working for me.

@fabpot
Copy link
Member

@Tobion Can you have a look at this one?

@fabpot
Copy link
Member

@hjkl Have you tested@xabbuh's suggestion instead?

@Tobion
Copy link
Contributor

Tobion commentedJun 16, 2016
edited
Loading

@hjkl please changegetMergeSql (probably rename it as well togetMergeStatement) to return the PDO statement directly with the params already bound. Since the params and the sql are now dependent on each other, it should be done in one place.
Apart from that it looks correct to me.

@Tobion
Copy link
Contributor

This PR needs a rebase.

@hjkl
Copy link
ContributorAuthor

@fabpot I haven't attempted@xabbuh's suggestion - I don't have the TSQL expertise to refactor the merge query to only use each parameter once.

@Tobion Done, thanks for the advice.

@Tobion
Copy link
Contributor

Tobion commentedJun 18, 2016
edited
Loading

Imo a proper fix would rather change the queries to not use a named parameter more than once.

This is exactly what this PR does. NAMED params cannot be used more than once but it's not possible to change the MERGE queries to only use each param once as they need to be repeated. It only works for the MySQL for example because mysql supports theVALUES($this->dataCol) syntax to reuse values. Otherwise we would also be forced into using numeric values several times for mysql. For reference, if you disable emulated prepares in MySQL and use the same named param more than once you get aSQLSTATE[HY093]: Invalid parameter number error as I just tried.

👍 good to merge
Status: Reviewed

@fabpot
Copy link
Member

Thank you@hjkl.

@fabpotfabpot merged commitebf3a2f intosymfony:2.7Jun 19, 2016
fabpot added a commit that referenced this pull requestJun 19, 2016
This PR was merged into the 2.7 branch.Discussion----------[HttpFoundation] changed MERGE queries| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#17284| License | MIT| Doc PR | N/AChanged the MERGE queries for Oracle and SQL Server to use question mark parameter markers so they work with emulation disabled or enabled -fixes#17284Commits-------ebf3a2f Fixed oci and sqlsrv merge queries when emulation is disabled -fixes#17284
$mergeStmt->bindParam(6,$data, \PDO::PARAM_LOB);
$mergeStmt->bindParam(7,$maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(8,time(), \PDO::PARAM_INT);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@hjkl, could you please submit another PR fixing this minor CS issue? Thank you in advance.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@phansys sure, I can't see the coding standards issue though, could you please clarify for me?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure@hjkl, I refer toPSR-2 5.1:

}else {

Thank you.

hjkl added a commit to hjkl/symfony that referenced this pull requestJun 20, 2016
This was referencedJun 30, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@hjkl@xabbuh@slootjes@fabpot@Tobion@phansys@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp