Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
masseelch committed Sep 27, 2022
1 parent f312edd commit 25d7339
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dialect/sql/schema/mysql_test.go
Expand Up @@ -1375,9 +1375,9 @@ type mysqlMock struct {
}

func (m mysqlMock) start(version string) {
m.ExpectBegin()
m.ExpectQuery(escape("SHOW VARIABLES LIKE 'version'")).
WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("version", version))
m.ExpectBegin()
}

func (m mysqlMock) tableExists(table string, exists bool) {
Expand Down
2 changes: 1 addition & 1 deletion dialect/sql/schema/postgres_test.go
Expand Up @@ -1010,9 +1010,9 @@ type pgMock struct {
}

func (m pgMock) start(version string) {
m.ExpectBegin()
m.ExpectQuery(escape("SHOW server_version_num")).
WillReturnRows(sqlmock.NewRows([]string{"server_version_num"}).AddRow(version))
m.ExpectBegin()
}

func (m pgMock) tableExists(table string, exists bool) {
Expand Down
3 changes: 3 additions & 0 deletions dialect/sql/schema/sqlite.go
Expand Up @@ -46,6 +46,9 @@ func (d *SQLite) Tx(ctx context.Context) (dialect.Tx, error) {
}
tx := &tx{t}
cm, err := sqlite.CommitFunc(ctx, db, tx, true)
if err != nil {
return nil, err
}
return &SQLiteTx{Tx: t, commit: cm, rollback: sqlite.RollbackFunc(ctx, db, tx, true)}, nil
}

Expand Down

0 comments on commit 25d7339

Please sign in to comment.