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

sqlbase: alias coltype.BigInt to VisibleType.BIGINT #20798

Merged

Conversation

nvanbenschoten
Copy link
Member

Fixes #19197.

This change cleans up the coltype to VisibleType alias mapping and adds
an alias for coltype.BigInt -> VisibleType.BIGINT.

The coltypes.Double -> VisibleType.DOUBLE_PRECISION mapping referenced in
the associated issue was already addressed during some previous refactor.

Release note (bug fix): The BIGINT type alias is now correctly shown
when using SHOW CREATE TABLE.

@nvanbenschoten nvanbenschoten requested review from lgo, richardwu and a team December 18, 2017 16:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@lgo lgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tossing the thought out there: is there any way changing the results seen in show_table would change how a driver interprets the column information?

LGTM thought.

@@ -21,6 +21,7 @@ var (
Bool = &TBool{Name: "BOOL"}
// Boolean is an immutable T instance.
Boolean = &TBool{Name: "BOOLEAN"}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just noticed this was some surgical spacing. Carry on :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional
space-1

@@ -53,6 +53,11 @@ func TestMakeTableDescColumns(t *testing.T) {
sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
true,
},
{
"BIGINT",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you're here, can you add one for DOUBLE PRECISION. We had a typo in the alias up until recently :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@richardwu
Copy link
Contributor

:lgtm:


Review status: 0 of 4 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending.


pkg/sql/table_test.go, line 57 at r1 (raw file):

Previously, lego (Joey Pereira) wrote…

while you're here, can you add one for DOUBLE PRECISION. We had a typo in the alias up until recently :(

I was also going to say maybe add test cases for INT8 and INT64.


Comments from Reviewable

Fixes cockroachdb#19197.

This change cleans up the `coltype` to `VisibleType` alias mapping and adds
an alias for `coltype.BigInt -> VisibleType.BIGINT`.

The `coltypes.Double -> VisibleType.DOUBLE_PRECISION` mapping referenced in
the associated issue was already addressed during some previous refactor.

Release note (bug fix): The BIGINT type alias is now correctly shown
when using SHOW CREATE TABLE.
@nvanbenschoten
Copy link
Member Author

TFTRs!

is there any way changing the results seen in show_table would change how a driver interprets the column information

I don't think any driver/ORM is going to parse the results of SHOW CREATE TABLE. I don't even think that it's standard syntax. Instead, they use pg_catalog/information_schema for things like that, which this doesn't touch.

@nvanbenschoten nvanbenschoten merged commit b70419d into cockroachdb:master Dec 18, 2017
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/alias branch December 18, 2017 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: Some INT and FLOAT alias conversions are illogical
4 participants