-
-
Notifications
You must be signed in to change notification settings - Fork 584
Closed
dolthub/go-mysql-server
#1349Labels
bugSomething isn't workingSomething isn't workinggood reproEasily reproducible bugsEasily reproducible bugssql serverIssues related to the built in SQL serverIssues related to the built in SQL server
Description
For every parameterized query that is issued, the sql-server seems to generate a INFO [no conn] kill query: pid 1089 {} style line on connection close. If a connection is used to issue large volumes of queries, then the log spam can be quite significant.
The following code can be run against an empty dolt sql-server:
package main
import (
"database/sql"
"flag"
_ "github.com/go-sql-driver/mysql"
)
var dbURI = flag.String("db", "", "URL of MySQL DB to connect to")
func main() {
flag.Parse()
db, err := sql.Open("mysql", *dbURI)
if err != nil {
panic(err)
}
defer db.Close()
// Change loop count to generate a log line per iteration:
for i := 0; i < 5; i++ {
var out int64
if err := db.QueryRow("SELECT ?", 1).Scan(&out); err != nil {
panic(err)
}
}
}Issuing a query like SELECT 1 doesn't cause log spam. I couldn't find any use of the database/sql APIs that would avoid the log spam when using parameters.
go.mod for good measure:
module repro
go 1.19
require github.com/go-sql-driver/mysql v1.6.0And dolt version:
$ dolt version
dolt version 0.50.8
database storage format: NEW ( __DOLT__ )
It seems like some internal resource isn't being released correctly until the connection itself is closed.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood reproEasily reproducible bugsEasily reproducible bugssql serverIssues related to the built in SQL serverIssues related to the built in SQL server