Skip to content

experimental_enable_hash_sharded_indexes takes incorrect values #46161

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

Closed
ericharmeling opened this issue Mar 16, 2020 · 3 comments · Fixed by #46163
Closed

experimental_enable_hash_sharded_indexes takes incorrect values #46161

ericharmeling opened this issue Mar 16, 2020 · 3 comments · Fixed by #46163
Assignees
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@ericharmeling
Copy link

Describe the problem

The experimental_enable_hash_sharded_indexes session variable only takes boolean values. When you set true, it shows on, and when you set false, it shows off.

You should be able to set on and off directly.

[email protected]:59143/movr> SET experimental_enable_hash_sharded_indexes=on;
ERROR: parameter "experimental_enable_hash_sharded_indexes" requires a Boolean value
SQLSTATE: 22023
DETAIL: 'on' is a string
[email protected]:59143/movr> SET experimental_enable_hash_sharded_indexes=true;
SET

Time: 225µs
[email protected]:59143/movr> SHOW experimental_enable_hash_sharded_indexes;
  experimental_enable_hash_sharded_indexes
--------------------------------------------
  on
(1 row)

Time: 488µs
[email protected]:59143/movr> SET experimental_enable_hash_sharded_indexes=off;
ERROR: parameter "experimental_enable_hash_sharded_indexes" requires a Boolean value
SQLSTATE: 22023
DETAIL: 'off' is a string
[email protected]:59143/movr> SET experimental_enable_hash_sharded_indexes=false;
SET

Time: 232µs
[email protected]:59143/movr> SHOW experimental_enable_hash_sharded_indexes;
  experimental_enable_hash_sharded_indexes
--------------------------------------------
  off
(1 row)

Environment:

  • CockroachDB version : [CockroachDB OSS v20.1.0-beta.2-846-ga94dfeb42c (x86_64-apple-darwin19.3.0, built 2020/03/16 18:08:45, go1.13.4)
  • Server OS: macOS
  • Client app: cockroach demo
@ericharmeling ericharmeling added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-pgcompat Semantic compatibility with PostgreSQL labels Mar 16, 2020
@rohany
Copy link
Contributor

rohany commented Mar 16, 2020

This seems to affect experimental_enable_temp_tables as well.

@rohany
Copy link
Contributor

rohany commented Mar 16, 2020

Actually, this is the case with nearly all of our cluster setttings!

@rohany rohany assigned rohany and unassigned ajwerner Mar 16, 2020
rohany added a commit to rohany/cockroach that referenced this issue Mar 16, 2020
Fixes cockroachdb#46161.

Release justification: bug fix
Release note (bug fix): This PR fixes a bug where various session
variables whose value would display as "on" or "off" could not be
set to the values "on" or "off", only true or false.
@ericharmeling
Copy link
Author

ericharmeling commented Mar 16, 2020

Actually, this is the case with nearly all of our cluster setttings!

Ah. You're right!

@ericharmeling ericharmeling reopened this Mar 16, 2020
rohany added a commit to rohany/cockroach that referenced this issue Mar 17, 2020
Session variables were incorrectly erroring out on
string inputs even though string values of "on" and
"off" are accepted.

Fixes cockroachdb#46161.

Release justification: bug fix
Release note (bug fix): This PR fixes a bug where various session
variables whose value would display as "on" or "off" could not be
set to the values "on" or "off", only true or false.
rohany added a commit to rohany/cockroach that referenced this issue Mar 17, 2020
Session variables were incorrectly erroring out on
string inputs even though string values of "on" and
"off" are accepted.

Fixes cockroachdb#46161.

Release justification: bug fix
Release note (bug fix): This PR fixes a bug where various session
variables whose value would display as "on" or "off" could not be
set to the values "on" or "off", only true or false.
craig bot pushed a commit that referenced this issue Mar 17, 2020
45827: sql: make SHOW USERS/SHOW ROLES match psql \du command. r=knz a=RichardJCai

Release note (sql change): Make SHOW USERS and SHOW ROLES the same since USERS=ROLES.
Make SHOW USERS and SHOW ROLES match psql \du command. SHOW ROLES displays three columns, username, options, member_of.

Release justification: Low risk change, only changing underlying select command for SHOW ROLES/USERS.

46111: opt: support EXPLAIN BUNDLE as a prepared statement r=RaduBerinde a=RaduBerinde

Some clients / drivers might issue EXPLAIN BUNDLE with the parse/bind/exec
protocol (e.g. DBeaver).

This change also fixes an error message in the optimizer - it was left over from
when we would fall back on HP; now this condition is an internal error.

Fixes #46020.

Release note (bug fix): EXPLAIN BUNDLE now works when the client driver prepares
the statement (as is the case with DBeaver).

Release justification: Bug fixes and low-risk updates to new functionality.

46163: sql: fix bug where some session vars couldn't be set to "on" or "off" r=rohany a=rohany

Session variables were incorrectly erroring out on
string inputs even though string values of "on" and
"off" are accepted.

Fixes #46161.

Release justification: bug fix
Release note (bug fix): This PR fixes a bug where various session
variables whose value would display as "on" or "off" could not be
set to the values "on" or "off", only true or false.

Co-authored-by: richardjcai <[email protected]>
Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: Rohan Yadav <[email protected]>
@craig craig bot closed this as completed in a000dbc Mar 17, 2020
rohany added a commit to rohany/cockroach that referenced this issue Mar 18, 2020
Session variables were incorrectly erroring out on
string inputs even though string values of "on" and
"off" are accepted.

Fixes cockroachdb#46161.

Release justification: bug fix
Release note (bug fix): This PR fixes a bug where various session
variables whose value would display as "on" or "off" could not be
set to the values "on" or "off", only true or false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants