Skip to content

Commit

Permalink
Merge pull request #140 from scylladb/generate_empty_strings
Browse files Browse the repository at this point in the history
Generate empty strings
  • Loading branch information
Henrik Johansson authored Jun 18, 2019
2 parents fad33c4 + 0f94161 commit 2c84815
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const (
TYPE_VARCHAR = SimpleType("varchar")
TYPE_VARINT = SimpleType("varint")

MaxBlobLength = 1e6
MinBlobLength = 1000
MaxBlobLength = 1e4
MinBlobLength = 0
MaxStringLength = 1000
MinStringLength = 100
MinStringLength = 0
MaxTupleParts = 20
MaxUDTParts = 20
)
Expand Down Expand Up @@ -77,6 +77,9 @@ func (st SimpleType) CQLPretty(query string, value []interface{}) (string, int)
replacement = fmt.Sprintf("'%s'", value[0])
case TYPE_BLOB:
if v, ok := value[0].(string); ok {
if len(v) > 100 {
v = v[:100]
}
replacement = "textasblob('" + v + "')"
}
case TYPE_BIGINT, TYPE_INT, TYPE_SMALLINT, TYPE_TINYINT:
Expand Down

0 comments on commit 2c84815

Please sign in to comment.