pingcap / pingcap/tiup

tiup client does not accept input on STDIN

Open
#1,288 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/feature-request
Dominant language
Go
Stars
466
Forks
338
Avg merge
3d 7h
Merged PRs (30d)
8

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

tiup client does not accept input on STDIN. This makes it hard to use as a replacement for mysql with any scripting.

  1. What did you expect to see?
$ echo "show databases" | mysql
Database
INFORMATION_SCHEMA
METRICS_SCHEMA
PERFORMANCE_SCHEMA
mysql
test
  1. What did you see instead?
$ echo "show databases" | tiup client
Starting component `client`: 
Connected with driver mysql (5.7.25-TiDB-v4.0.12)
  1. What version of TiUP are you using (tiup --version)?
$ tiup --version
1.4.0 tiup
Go Version: go1.16.2
Git Ref: v1.4.0
GitHash: eb335e6ad9d0dc19d1c43db422cd409d62bc3cea

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the tiup client command entry point and trace how it reads input when invoked through STDIN. Verify the behavior with a piped show databases command; done means tiup client accepts piped SQL and produces query output like the reported mysql example.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.