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

Revert "Merge pull request #888 from goetas/update-query" #1071

Merged
merged 2 commits into from
Nov 6, 2020

Conversation

lyrixx
Copy link
Contributor

@lyrixx lyrixx commented Nov 5, 2020

This reverts commit b13df49, reversing
changes made to b5d7611.

Q A
Type bug
BC Break no
Fixed issues fixes #888 (comment)

@greg0ire
Copy link
Member

greg0ire commented Nov 6, 2020

reversing changes made to b5d7611.

I think you meant 595489b, and if that's the case, why not just git revert 595489b4c456a6926365e270cdaba8c401350506?

@lyrixx
Copy link
Contributor Author

lyrixx commented Nov 6, 2020

@greg0ire this commit message generated by git itself 😬. I understand the message is confusing, but it talks about the parent

@greg0ire
Copy link
Member

greg0ire commented Nov 6, 2020

Oh right, I misread, didn't notice it was changes applied to b5d7611 . Anyway, an automated message cannot be as good as the one you could write as suggested in #888 (comment) , please edit the message to include the information to understand why that revert is necessary.

@goetas
Copy link
Member

goetas commented Nov 6, 2020

I'm sorry that this created so many issue, but i'm ok for reverting it 👍

from: https://dev.mysql.com/doc/refman/8.0/en/repair-table.html

> REPAIR TABLE returns a result set with the columns shown in the
following table.

That's why doctrine/migrations should not use `executeUpdate`, because
results are not read. So the user can end with the following errors

```
  SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
other unbuffered queries are active.  Consider using
PDOStatement::fetchAll().  Alternatively, if your code is only ever
going to run against mysql, you may enable query buffering by
setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
```

More over, `executeUpdate` is deprecated
@lyrixx
Copy link
Contributor Author

lyrixx commented Nov 6, 2020

@greg0ire is it OK now ?

@greg0ire greg0ire added the Bug label Nov 6, 2020
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

I think you got it right with the commit message, but wrong with the code comment

Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
@greg0ire
Copy link
Member

greg0ire commented Nov 6, 2020

There is a new failure I didn't see before in Appveyor, but since this is a revert, it's fine to merge, let's proceed, hopefully we will be able to fix the build soon 😬

@greg0ire greg0ire merged commit 384cf73 into doctrine:2.3.x Nov 6, 2020
@greg0ire
Copy link
Member

greg0ire commented Nov 6, 2020

Thanks @lyrixx !

@greg0ire greg0ire added this to the 2.3.1 milestone Nov 6, 2020
@lyrixx lyrixx deleted the revert-888 branch November 7, 2020 00:50
@lyrixx
Copy link
Contributor Author

lyrixx commented Dec 2, 2020

Hello,

May I ask for a release of 2.3.1?

Thanks

@@ -345,10 +345,11 @@ private function executeVersionExecutionResult(

$this->outputSqlQuery($key, $query);

// executeQuery() must be used here because $query might return a result set, for instance REPAIR does
Copy link
Member

Choose a reason for hiding this comment

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

then, to be sure to be compatible with PrimaryReadReplicaConnection (which allows executeQuery to run on the read replicas), we should add a check to call ensureConnectedToPrimary when the connection is a PrimaryReadReplicaConnection (for transactional migrations, there is a good chance to be connected on the primary due to starting the transaction, but it is possible to disable all usages transactions in doctrine/migrations AFAIK)

Copy link
Member

Choose a reason for hiding this comment

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

That wouldn't qualify as a bugfix, so in 3.1.x, right? That being said, your remark makes me notice that we have instanceof MasterSlaveConnection that should be replaced with instanceof PrimaryReadReplicaConnection

Copy link
Member

Choose a reason for hiding this comment

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

Attempt at a fix: #1096

@greg0ire
Copy link
Member

greg0ire commented Dec 2, 2020

@lyrixx I hope to get #1096 merged soon and then let's do a release 👍

@greg0ire
Copy link
Member

greg0ire commented Dec 5, 2020

@lyrixx released as https://github.com/doctrine/migrations/releases/tag/2.3.1

@lyrixx
Copy link
Contributor Author

lyrixx commented Dec 21, 2020

hello @greg0ire ; Now I'm trying to update to 3.x, and I'm facing the very same issue :)
Could you release 3.0.2 ? thx

@greg0ire
Copy link
Member

I was on holidays, but it looks like you have been heard: https://github.com/doctrine/migrations/releases/tag/3.0.2 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants