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

IGNITE-9606: JDBC getPrimaryKeys() returns wrong value for COLUMN_NAME #4906

Closed
wants to merge 4 commits into from

Conversation

pavel-kuznetsov
Copy link
Contributor

No description provided.

Earlier, if key was of SQL type (so not wrapped), corresponding property thought that it is not a key. This behaviour affected what COLUMN_NAME JDBC metadata would contain.
isKeyField = false;
if (isKeyClsSqlType)
// In case of field is neither composite nor wrapped, it is a key, if it equal to keyFieldName.
isKeyField = entry.getKey().equals(qryEntity.getKeyFieldName());
else
isKeyField = (hasKeyFields ? keyFields.contains(entry.getKey()) : null);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could someone explain, when we need to set isKeyField to null?

isKeyField = false;
if (isKeyClsSqlType)
// In case of field is neither composite nor wrapped, it is a key, if it equal to keyFieldName.
isKeyField = entry.getKey().equals(qryEntity.getKeyFieldName());
Copy link
Contributor

Choose a reason for hiding this comment

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

is it correct that you check it case sensitive?

prop.name() used to return UPPERCASED name of the field. So comparison with keyFieldName/valueFieldName (which are not uppercased) was incorrect. Probably, this validation logic should be revisited.
Used aliases map instead of normalizing keyFieldName all the time.
@pavel-kuznetsov
Copy link
Contributor Author

Afrer review, decieded to fix problem in another way
see #4948

asfgit pushed a commit that referenced this pull request Oct 12, 2018
devozerov pushed a commit to gridgain/apache-ignite that referenced this pull request Oct 12, 2018
@devozerov devozerov deleted the ignite-9606 branch October 12, 2018 12:28
akalash pushed a commit to gridgain/apache-ignite that referenced this pull request Nov 19, 2018
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.

None yet

3 participants