From 4d81616a0931582e5da16d7853c70d659cca1a1d Mon Sep 17 00:00:00 2001 From: Preety Papneja Date: Tue, 10 Oct 2023 21:56:51 +0530 Subject: [PATCH] test: Testing --- ldb_reader.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ldb_reader.go b/ldb_reader.go index c8c03c6..6fc6245 100644 --- a/ldb_reader.go +++ b/ldb_reader.go @@ -241,7 +241,15 @@ func (reader *LDBReader) GetRowsByKeyPrefixLike(ctx context.Context, familyName if len(key) == 0 { globalstats.Incr("full-table-scans", familyName, tableName) } - rows, err := stmt.QueryContext(ctx, key...) + // Initialize a slice to hold the modified keys + var modifiedKeys []interface{} + + for _, k := range key { + // Modify each key to include % characters + modifiedKey := "%" + k.(string) + "%" // Ensure k is converted to a string + modifiedKeys = append(modifiedKeys, modifiedKey) + } + rows, err := stmt.QueryContext(ctx, modifiedKeys...) switch { case err == nil: cols, err := schema.DBColumnMetaFromRows(rows) @@ -298,6 +306,8 @@ func (reader *LDBReader) getRowsByKeyPrefixStmtLike(ctx context.Context, pk sche } } qs := strings.Join(qsTokens, " ") + events.Log("query string is %v", qs) + events.Log("query token string is %v", qsTokens) stmt, err := reader.Db.PrepareContext(ctx, qs) if err == nil { reader.getRowsByKeyPrefixStmtCache[pck] = stmt