Skip to content

Commit

Permalink
Fixed UDT data type comparision for "text" fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenick committed Aug 5, 2015
1 parent 1c89988 commit dc2955e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/data_type.hpp
Expand Up @@ -96,7 +96,15 @@ class DataType : public RefCounted<DataType> {
}

virtual bool equals(const SharedRefPtr<const DataType>& data_type) const {
return value_type_ == data_type->value_type_;
switch (value_type_) {
// "text" is an alias for "varchar"
case CASS_VALUE_TYPE_TEXT:
case CASS_VALUE_TYPE_VARCHAR:
return data_type->value_type_ == CASS_VALUE_TYPE_TEXT ||
data_type->value_type_ == CASS_VALUE_TYPE_VARCHAR;
default:
return value_type_ == data_type->value_type_;
}
}

virtual DataType* copy() const {
Expand Down

0 comments on commit dc2955e

Please sign in to comment.