Skip to content

Column is case sensitive #679

@shiyuhang0

Description

@shiyuhang0

Bug Report

1. Describe the bug

ColumnRef class is case insensitive for its name field.

public String getName() {
    return name.toLowerCase();
  }

 @Override
  public boolean equals(Object another) {
    if (this == another) {
      return true;
    }

    if (another instanceof ColumnRef) {
      ColumnRef that = (ColumnRef) another;
      if (isResolved() && that.isResolved()) {
        return name.equalsIgnoreCase(that.name)
            && this.dataType.equals(((ColumnRef) another).dataType);
      } else {
        return name.equalsIgnoreCase(that.name);
      }

    } else {
      return false;
    }
  }

However, the hashcode method is case sensitive.

@Override
  public int hashCode() {
    if (isResolved()) {
      return Objects.hash(this.name, this.dataType);
    } else {
      return Objects.hashCode(name);
    }
  }

2. Minimal reproduce step (Required)

3. What did you see instead (Required)

4. What did you expect to see? (Required)

5. What are your Java Client and TiKV versions? (Required)

  • Client Java:
  • TiKV:

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions