Skip to content

Commit

Permalink
do not send "select" in cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
suxb201 committed Feb 28, 2023
1 parent 2937df8 commit 865937d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/reader/scan_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ func (r *scanReader) scan() {
scanDbIdUpper = 0
}
for dbId := 0; dbId <= scanDbIdUpper; dbId++ {
var cursor uint64 = 0
if !r.isCluster {
reply := r.clientScan.DoWithStringReply("SELECT", strconv.Itoa(dbId))
if reply != "OK" {
log.Panicf("scanReader select db failed. db=[%d]", dbId)
}

reply := r.clientScan.DoWithStringReply("SELECT", strconv.Itoa(dbId))
if reply != "OK" {
log.Panicf("scanReader select db failed. db=[%d]", dbId)
r.clientDump.Send("SELECT", strconv.Itoa(dbId))
r.innerChannel <- &dbKey{dbId, "", true}
}

r.clientDump.Send("SELECT", strconv.Itoa(dbId))
r.innerChannel <- &dbKey{dbId, "", true}

var cursor uint64 = 0
for {
var keys []string
cursor, keys = r.clientScan.Scan(cursor)
Expand Down

0 comments on commit 865937d

Please sign in to comment.