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

logictest -rewrite flag incorrectly formats SHOW CREATE TABLE indentation #83586

Closed
ecwall opened this issue Jun 29, 2022 · 0 comments · Fixed by #91702
Closed

logictest -rewrite flag incorrectly formats SHOW CREATE TABLE indentation #83586

ecwall opened this issue Jun 29, 2022 · 0 comments · Fixed by #91702
Assignees
Labels
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

@ecwall
Copy link
Contributor

ecwall commented Jun 29, 2022

Running logic tests with the -rewrite flag causes the indentation for SHOW CREATE TABLE to have too much indentation. It looks like the column definitions are always spaced to the right of the WITH (...).

Results as of 1bf3243448c15a94546ea609380fa02a050edf11 on master:

statement ok
CREATE TABLE tbl (
  id INT PRIMARY KEY,
  text TEXT,
  FAMILY (id, text)
) WITH (ttl_expire_after = '10 minutes')

query T
SELECT create_statement FROM [SHOW CREATE TABLE tbl]
----
CREATE TABLE public.tbl (
                                                                                                                      id INT8 NOT NULL,
                                                                                                                      text STRING NULL,
                                                                                                                      crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL,
                                                                                                                      CONSTRAINT tbl_pkey PRIMARY KEY (id ASC),
                                                                                                                      FAMILY fam_0_id_text_crdb_internal_expiration (id, text, crdb_internal_expiration)
) WITH (ttl = 'on', ttl_automatic_column = 'on', ttl_expire_after = '00:10:00':::INTERVAL, ttl_job_cron = '@hourly')

The formatting is correct in the CLI:

demo@127.0.0.1:26257/movr> CREATE TABLE tbl (
  id INT PRIMARY KEY,
  text TEXT,
  FAMILY (id, text)
) WITH (ttl_expire_after = '10 minutes');
CREATE TABLE


Time: 11ms total (execution 10ms / network 1ms)

demo@127.0.0.1:26257/movr> SELECT create_statement FROM [SHOW CREATE TABLE tbl];
                                                                                            create_statement
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  CREATE TABLE public.tbl (
      id INT8 NOT NULL,
      text STRING NULL,
      crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL,
      CONSTRAINT tbl_pkey PRIMARY KEY (id ASC),
      FAMILY fam_0_id_text_crdb_internal_expiration (id, text, crdb_internal_expiration)
  ) WITH (ttl = 'on', ttl_automatic_column = 'on', ttl_expire_after = '00:10:00':::INTERVAL, ttl_job_cron = '@hourly')
(1 row)

Jira issue: CRDB-17156

@ecwall ecwall added 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) labels Jun 29, 2022
@ecwall ecwall self-assigned this Jun 29, 2022
@ecwall ecwall removed their assignment Oct 31, 2022
@ecwall ecwall self-assigned this Nov 10, 2022
craig bot pushed a commit that referenced this issue Nov 10, 2022
89971: backupccl: update progress more frequently r=adityamaru a=stevendanna

A code comment in the ChunkProgressLogger implementation says:

> To avoid hammering the system.jobs table, when a response comes
> back, we issue a progress update only if a) it's been a duration of
> progressTimeThreshold since the last update, or b) the difference between the
> last logged fractionCompleted and the current fractionCompleted is more than
> progressFractionThreshold.

But as implemented, it would only update the progress if both of those conditions were true. For very large or very slow backups, this meant that progress updates could be _very_ far about, which is a bit disconcerting.

Here, I've changed the condition to match the comment, so now, if progress has been made, we should see an update every 15 seconds.

Epic: None
Release note (bug fix): Fix bug that could result in infrequent progress updates for very large backup or restore jobs.

91702: sql: fix logic test multiline and tabbed  output r=rafiss a=ecwall

fixes #83586

This fixes 2 issues with logic test output:
1) Tabs no longer interfere with tabwriter column output.
2) Newlines no longer interfere with tabwriter row output.

Release note: None

91706: settingswatcher: address todo for GetStorageClusterVersion r=ajstorm,renatolabs a=rafiss

v22 is now minted, so we can use it in this function. On the release-22.2 branch, it's only minted in v22.2.0-rc.1, so we can no longer use v22.2.0-beta.5 for the mixed version tests.

Epic: None

Release note: None

91712: sql: skip flakey TestSQLStatsIdleLatencies r=ericharmeling a=ericharmeling

This commit skips TestSQLStatsIdleLatencies.

Part of #91710.

Release note: None

Co-authored-by: Steven Danna <danna@cockroachlabs.com>
Co-authored-by: Evan Wall <wall@cockroachlabs.com>
Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Co-authored-by: Eric Harmeling <eric.harmeling@cockroachlabs.com>
@craig craig bot closed this as completed in 67be2e3 Nov 10, 2022
blathers-crl bot pushed a commit that referenced this issue Nov 10, 2022
fixes #83586

This fixes 2 issues with logic test output:
1) Tabs no longer interfere with tabwriter column output.
2) Newlines no longer interfere with tabwriter row output.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant