github dolthub/dolt v0.27.4
0.27.4

latest releases: v1.38.1, v1.38.0, v1.37.0...
2 years ago

Merged PRs

dolt

  • 2017: if no working or staged hash exists in the repo file use head
  • 2013: Andy/alter drop pks

go-mysql-server

  • 528: Hacky version of read committed isolation level, which begins a new t…
    …ransaction on every statement. Basically it's read committed, but without the ability to turn off auto commit
  • 519: Fix explicit DEFAULT value in insert query
    It seems that go-mysql-server is not compatible with insert query like:
    INSERT INTO `users` (`id`, `deleted`) VALUES (1, DEFAULT)
    Whereas DEFAULT is just to specify deleted columns should use column default value explicitly.
    The issue could be demostrated using below code:
    package main
    import (
    dbsql "database/sql"
    sqle "github.com/dolthub/go-mysql-server"
    "github.com/dolthub/go-mysql-server/auth"
    "github.com/dolthub/go-mysql-server/memory"
    "github.com/dolthub/go-mysql-server/server"
    _ "github.com/go-sql-driver/mysql"
    )
    func main() {
    db, _ := dbsql.Open("mysql", "root:@tcp(127.0.0.1:3307)/test")
    defer db.Close()
    query := `CREATE TABLE users (
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    deleted tinyint(1) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (id)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4`
    stmt, _ := db.Prepare(query)
    stmt.Exec()
    _, err := db.Exec("INSERT INTO `users` (`id`, `deleted`) VALUES (1, DEFAULT)")
    if err != nil {
    panic(err.Error())
    }
    stmtOut, _ := db.Prepare("SELECT `deleted` FROM `users` WHERE `id` = 1")
    defer stmtOut.Close()
    deleted := true
    err = stmtOut.QueryRow().Scan(&deleted)
    if err != nil {
    panic(err.Error())
    }
    if deleted == true {
    panic("Wrong deleted value")
    }
    }
    var engine *sqle.Engine
    func init() {
    engine = sqle.NewDefault()
    db := memory.NewDatabase("test")
    engine.AddDatabase(db)
    config := server.Config{
    Protocol: "tcp",
    Address:  "localhost:3307",
    Auth:     auth.NewNativeSingle("root", "", auth.AllPermissions),
    }
    s, _ := server.NewDefaultServer(config, engine)
    go s.Start()
    }
    `db.Exec("INSERT INTO `users` (`id`, `deleted`) VALUES (1, DEFAULT)")` will result in error:
    Error 1105: plan is not resolved because of node '*plan.Values'
    
    This pull request should avoid such issue by turning explicit DEFAULT in insert query to implicit.

Closed Issues

  • 1782: Conflict Logging/Resolution for UNIQUE KEYs

Don't miss a new dolt release

NewReleases is sending notifications on new releases.