-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
cli: does not properly respect the bytea_output setting for displaying BYTEA values #80398
Labels
A-cli-client
CLI commands that pertain to using SQL features
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Comments
rafiss
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
A-cli-client
CLI commands that pertain to using SQL features
labels
Apr 22, 2022
blathers-crl
bot
added
the
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
label
Apr 22, 2022
cucaroach
added a commit
to cucaroach/cockroach
that referenced
this issue
Oct 10, 2023
In cockroachdb#80398 we fixed the CLI to respect bytea_output session variable and properly output BYTES columns in \xDEADBEEF format. Now we don't need the extra hex_ columns. This makes debug.zips smaller and quicker to create (jobs payloads can get big and so can descriptors for large tables). In order not to break cockroach debug decode-proto extend it to look for and remove the \x prefix when attempting to decode hex. Fixes: cockroachdb#112032 Epic: none Release note (cli change): debug zip's no longer include redundant hex_ columns for system table BYTES columns.
craig bot
pushed a commit
that referenced
this issue
Oct 10, 2023
112033: cli: remove redundant hex_ columns in debug.zip output r=rickystewart a=cucaroach In #80398 we fixed the CLI to respect bytea_output session variable and properly output BYTES columns in \xDEADBEEF format. Now we don't need the extra hex_ columns. This makes debug.zips smaller and quicker to create (jobs payloads can get big and so can descriptors for large tables). In order not to break cockroach debug decode-proto extend it to look for and remove the \x prefix when attempting to decode hex. Fixes: #112032 Epic: none Release note (cli change): debug zip's no longer include redundant hex_ columns for system table BYTES columns. 112040: sctest: Skip "crdb_internal" entry in comparator testing from logictest corpus r=Xiang-Gu a=Xiang-Gu Statements collected from `crdb_internal` is of little interest to us for the purpose of schema changer comparator testings, as it contains only `crdb_internal` functions. Furthermore, there are statements that will crash our framework, such as `SELECT crdb_internal.force_panic('foo')`. This commit therefore adds a check to skip it. This check will also home any future skipped entries for whatever reason. Epic: None Release note: None 112067: sql: fix minor bugs and add tests for procedures r=mgartner a=mgartner #### sql: add tests for procedures with anonymous arguments Release note: None Epic: CRDB-25388 #### sql: fix `CREATE OR REPLACE PROCEDURE` and add tests This commit fixes a minor bug with `CREATE OR REPLACE PROCEDURE` that allowed it to replace functions. The bug also allowed `CREATE OR REPLACE FUNCTION` to replace procedures. Tests for `CREATE OR REPLACE PROCEDURE` have also been added. Release note: None #### sql: fix routine-related error messages This commit fixes some minor bugs with the error message of routine-related statements. Release note: None 112074: optbuilder: move insert fast path test to optbuilder r=msirek a=msirek This commit moves an insert fast path uniqueness check test case involving a volatile expression to a more applicable BuilderTest. Epic: CRDB-26290 Informs: #58047 Release note: None 112086: serverutils: use options for SQL connections r=knz a=herkolategan Previously `ApplicationLayerInterface` contained multiple `SQLConn` method variants for passing connection parameters. Various tests throughout the code use `SQLConn` or `PGUrl` to connect, but the latter does not take into account virtual clusters unless informed. This PR is meant to enable `SQLConn` to become a standard replacement for `PGUrl` in order to leverage the probabilistic nature of the tests which select between running a second virtual cluster or not. Numerous tests still use `PGUrl` and pass user, password, or cert details. These tests will soon be updated to start using `SQLConn` and hence should have the same functionality available. This enables the test to not have to deal with querying its probabilistic mode to determine if it should pass a virtual cluster name to `PGUrl`. The `ApplicationLayerInterface` already handles this logic and tests should leverage this. See also: #111134 Epic: CRDB-31933 Release note: None 112096: optbuilder: move finishBuildLastStmt to routine.go r=mgartner a=mgartner When routine-related optbuilder logic was moved to a new file, `routine.go`, the `finishBuildLastStmt` function was missed. This commit corrects that mistake. Epic: CRDB-25388 Release note: None 112097: sql/logictest: add CALL statements to drop_procedure r=mgartner a=mgartner This commit improves the coverage of tests in `drop_procedure` by adding `CALL` statements to ensure that dropped procedures cannot be executed. Epic: CRDB-25388 Release note: None Co-authored-by: Tommy Reilly <treilly@cockroachlabs.com> Co-authored-by: Xiang Gu <xiang@cockroachlabs.com> Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com> Co-authored-by: Mark Sirek <sirek@cockroachlabs.com> Co-authored-by: Herko Lategan <herko@cockroachlabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-cli-client
CLI commands that pertain to using SQL features
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Describe the problem
The cockroach cli shows BYTEA values in a go-escaped format, which is difficult to work with if you want to use the value by copy/pasting it into a different SQL command.
To Reproduce
Connect to a CRDB cluster using
cockroach sql
and run:Expected behavior
If you connect using
psql
to the same cluster, you get:Environment:
Additional context
Using a cast like
select descriptor::text from system.descriptor limit 1;
does work correctly.@knz points out that the behavior is a limitation of lib/pq, see:
cockroach/pkg/cli/clisqlexec/format_value.go
Lines 90 to 106 in 11a0a9f
Moving the CLI to use pgx could help address this issue.
Jira issue: CRDB-15625
The text was updated successfully, but these errors were encountered: