qiniu / logkit
Showing 1 of 1 files from the diff.

@@ -794,19 +794,23 @@
Loading
794 794
	r.muxOffsets.RLock()
795 795
	defer r.muxOffsets.RUnlock()
796 796
797 +
	link := "WHERE"
798 +
	if strings.Contains(strings.ToUpper(rawSQL), "WHERE") {
799 +
		link = "AND"
800 +
	}
797 801
	if len(r.timestampKey) > 0 {
798 802
		if r.timestampKeyInt {
799 -
			return fmt.Sprintf("%s WHERE %s >= %v and %s < %v;", rawSQL, r.timestampKey, r.startTimeInt, r.timestampKey, r.startTimeInt+int64(r.batchDurInt))
803 +
			return fmt.Sprintf("%s %s %s >= %v AND %s < %v;", rawSQL, link, r.timestampKey, r.startTimeInt, r.timestampKey, r.startTimeInt+int64(r.batchDurInt))
800 804
		}
801 805
		if r.startTimeStr == "" {
802 -
			return fmt.Sprintf("%s WHERE %s >= '%s' and %s < '%s';", rawSQL, r.timestampKey, r.startTime.Format(MysqlTimeFormat), r.timestampKey, r.startTime.Add(r.batchDuration).Format(MysqlTimeFormat))
806 +
			return fmt.Sprintf("%s %s %s >= '%s' AND %s < '%s';", rawSQL, link, r.timestampKey, r.startTime.Format(MysqlTimeFormat), r.timestampKey, r.startTime.Add(r.batchDuration).Format(MysqlTimeFormat))
803 807
		}
804 -
		return fmt.Sprintf("%s WHERE %s >= '%s';", rawSQL, r.timestampKey, r.startTimeStr)
808 +
		return fmt.Sprintf("%s %s %s >= '%s';", rawSQL, link, r.timestampKey, r.startTimeStr)
805 809
	}
806 810
807 811
	rawSQL = strings.TrimSuffix(strings.TrimSpace(rawSQL), ";")
808 812
	if len(r.offsetKey) > 0 && len(r.offsets) > idx {
809 -
		return fmt.Sprintf("%s WHERE %v >= %d AND %v < %d;", rawSQL, r.offsetKey, r.offsets[idx], r.offsetKey, r.offsets[idx]+int64(r.readBatch))
813 +
		return fmt.Sprintf("%s %s %v >= %d AND %v < %d;", rawSQL, link, r.offsetKey, r.offsets[idx], r.offsetKey, r.offsets[idx]+int64(r.readBatch))
810 814
	}
811 815
	return rawSQL
812 816
}
Files Coverage
conf 97.67%
mgr 65.62%
parser 86.87%
queue 74.13%
rateio 95.74%
reader 48.00%
router 54.13%
samples 100.00%
sender 44.94%
transforms 55.85%
utils 57.20%
audit/audit.go 73.63%
cleaner/cleaner.go 58.82%
cli/upgrade.go 47.56%
logkit.go 36.31%
self/logrunner.go 53.88%
times/times.go 91.30%
Project Totals (138 files) 56.87%
3950.1
TRAVIS_OS_NAME=linux
1.12.9=.12.9

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading