Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

[TRAFODION-2904] optionally add leading space when get a number colum… #1397

Merged
merged 2 commits into from Jan 16, 2018

Conversation

moscowgentalman
Copy link
Contributor

…n to display

@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2355/

@Traf-Jenkins
Copy link

@moscowgentalman
Copy link
Contributor Author

I will update the regression test expected file asap

@Traf-Jenkins
Copy link

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2357/

@Traf-Jenkins
Copy link

Copy link
Contributor

@DaveBirdsall DaveBirdsall left a comment

Choose a reason for hiding this comment

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

+1 Looks good to me. One question though.

// and then do the concat
sprintf(buf, "CAST(SPACE(%d - CHAR_LENGTH(CAST(@A1 AS VARCHAR(%d)))) || CAST(@A1 AS VARCHAR(%d)) AS VARCHAR(%d))",
dLen, dLen, dLen, dLen);
sprintf(buf, "CAST(CAST(@A1 AS VARCHAR(%d)) AS VARCHAR(%d))",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious: Why do we need two casts? Would one be enough? (Looks like we use the same length for both.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is my question as well :-)
I don't really understand the syntax here, if without the out CAST, the parser will fail to parse this string.
There are many such cases, I wish to understand the special syntax here later. But this is what it required for now.

@asfgit asfgit merged commit 5dbc250 into apache:master Jan 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants