Pārlūkot izejas kodu

The scan method for the db test expect sonly id and randomNumber. Unfortunately, some of the tests add their own columns to the table, which confused the scan function

Patrick Falls 12 gadi atpakaļ
vecāks
revīzija
1dc21609c9
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      go/src/hello/hello.go

+ 3 - 3
go/src/hello/hello.go

@@ -21,8 +21,8 @@ type World struct {
 }
 }
 
 
 const (
 const (
-	DB_CONN_STR   = "benchmarkdbuser:benchmarkdbpass@tcp(localhost:3306)/hello_world?charset=utf8"
-	DB_SELECT_SQL = "SELECT * FROM World where id = ?;"
+	DB_CONN_STR   = "benchmarkdbuser:benchmarkdbpass@tcp(172.16.98.98:3306)/hello_world?charset=utf8"
+	DB_SELECT_SQL = "SELECT id, randomNumber FROM World where id = ?;"
 	DB_ROWS       = 10000
 	DB_ROWS       = 10000
 )
 )
 
 
@@ -53,7 +53,7 @@ func jsonHandler(w http.ResponseWriter, r *http.Request) {
 }
 }
 
 
 func dbHandler(w http.ResponseWriter, r *http.Request) {
 func dbHandler(w http.ResponseWriter, r *http.Request) {
-	qnum := 1
+  	qnum := 1
 	if qnumStr := r.URL.Query().Get("queries"); len(qnumStr) != 0 {
 	if qnumStr := r.URL.Query().Get("queries"); len(qnumStr) != 0 {
 		qnum, _ = strconv.Atoi(qnumStr)
 		qnum, _ = strconv.Atoi(qnumStr)
 	}
 	}