Fix sql:cli in containerized environments (Docker, ddev)#6522
Open
douggreen wants to merge 1 commit intodrush-ops:14.xfrom
Open
Fix sql:cli in containerized environments (Docker, ddev)#6522douggreen wants to merge 1 commit intodrush-ops:14.xfrom
douggreen wants to merge 1 commit intodrush-ops:14.xfrom
Conversation
Fixes drush-ops#6521 Two issues prevented sql:cli from working in containerized environments: 1. hasPipedInput() false positive: stream_select() returns false positives in containers because stdin is a pipe/socket rather than a TTY, even when no data is being piped. Fix: check posix_isatty() first, and when not on a TTY, skip the unreliable stream_select() check entirely. 2. Missing TTY allocation: The setTty() call was commented out, so the mysql client had no interactive terminal and would exit immediately. Fix: Enable TTY when Process::isTtySupported() returns true.
Member
|
sql:cli works for me in DDEV. Could you try using a clone of this repo, since it has DDEV integration? |
Member
|
I merged a fix for 2. Its not happenning everywhere but its happenning in my current checkout with 12.x and mariadb so in it goes in #6537. I am not seeing a problem with 1. yet. Leaving this open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6521
Two issues prevented sql:cli from working in containerized environments:
hasPipedInput() false positive: stream_select() returns false positives in containers because stdin is a pipe/socket rather than a TTY, even when no data is being piped. Fix: check posix_isatty() first, and when not on a TTY, skip the unreliable stream_select() check entirely.
Missing TTY allocation: The setTty() call was commented out, so the mysql client had no interactive terminal and would exit immediately. Fix: Enable TTY when Process::isTtySupported() returns true.