Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Nov 22, 2023
1 parent 693a909 commit 887ed96
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 21 deletions.
5 changes: 3 additions & 2 deletions postgres/messages/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import (
"fmt"
"strings"

"github.com/dolthub/doltgresql/postgres/connection"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/postgres/connection"
)

func init() {
Expand Down Expand Up @@ -222,4 +223,4 @@ func (m Bind) DebugString() string {
builder.WriteString("}")

return builder.String()
}
}
3 changes: 2 additions & 1 deletion postgres/messages/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ package messages
import (
"fmt"

"github.com/dolthub/doltgresql/postgres/connection"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/postgres/connection"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions postgres/messages/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ package messages
import (
"fmt"

"github.com/dolthub/doltgresql/postgres/connection"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/postgres/connection"
)

func init() {
Expand Down Expand Up @@ -91,4 +92,3 @@ func (m Execute) DefaultMessage() *connection.MessageFormat {
func (m Execute) DebugString() string {
return fmt.Sprintf("Execute {\n Portal: %s\n RowMax: %d\n}", m.Portal, m.RowMax)
}

6 changes: 3 additions & 3 deletions postgres/messages/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import (
"fmt"
"strings"

"github.com/dolthub/doltgresql/postgres/connection"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/postgres/connection"
)

func init() {
Expand Down Expand Up @@ -113,7 +114,6 @@ func (m Parse) DefaultMessage() *connection.MessageFormat {
return &parseDefault
}


// DebugString returns a debug representation of the Parse message.
func (m Parse) DebugString() string {
var builder strings.Builder
Expand All @@ -129,4 +129,4 @@ func (m Parse) DebugString() string {
builder.WriteString("}")

return builder.String()
}
}
3 changes: 2 additions & 1 deletion postgres/messages/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ package messages
import (
"fmt"

"github.com/dolthub/doltgresql/postgres/connection"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/postgres/connection"
)

func init() {
Expand Down
3 changes: 2 additions & 1 deletion postgres/messages/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
package messages

import (
"github.com/dolthub/doltgresql/postgres/connection"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/postgres/connection"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions postgres/parser/sem/tree/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,6 @@ func (node *UnaryExpr) String() string { return AsString(node) }
func (node DefaultVal) String() string { return AsString(node) }
func (node PartitionMaxVal) String() string { return AsString(node) }
func (node PartitionMinVal) String() string { return AsString(node) }
func (node *Placeholder) String() string { return AsString(node) }
func (d NullLiteral) String() string { return AsString(d) }
func (list *NameList) String() string { return AsString(list) }
func (node *Placeholder) String() string { return AsString(node) }
func (d NullLiteral) String() string { return AsString(d) }
func (list *NameList) String() string { return AsString(list) }
1 change: 0 additions & 1 deletion server/converted_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ type ConvertedQuery struct {
String string
AST vitess.Statement
}

4 changes: 2 additions & 2 deletions server/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (l *Listener) HandleConnection(conn net.Conn) {
returnErr = err
return
}

if ds, ok := message.(sql.DebugStringer); ok {
if logrus.IsLevelEnabled(logrus.DebugLevel) {
logrus.Debugf("Received message: %s", ds.DebugString())
Expand Down Expand Up @@ -430,7 +430,7 @@ func (l *Listener) execute(conn net.Conn, mysqlConn *mysql.Conn, query Converted
// describe handles the description of the given query. This will post the ParameterDescription and RowDescription messages.
func (l *Listener) describe(conn net.Conn, mysqlConn *mysql.Conn, message messages.Describe, statement ConvertedQuery) (err error) {
logrus.Tracef("describing statement %v", statement)

//TODO: fully support prepared statements
if err := connection.Send(conn, messages.ParameterDescription{
ObjectIDs: nil,
Expand Down
4 changes: 2 additions & 2 deletions testing/go/prepared_statement_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestPreparedStatements(t *testing.T) {
},
Assertions: []ScriptTestAssertion{
{
Query: "select v1 from doesNotExist where pk = 1;",
Query: "select v1 from doesNotExist where pk = 1;",
ExpectedErr: true,
},
{
Expand Down Expand Up @@ -104,7 +104,7 @@ func RunScriptN(t *testing.T, script ScriptTest, n int) {
} else {
require.NoError(t, err)
}

defer rows.Close()
foundRows, err := ReadRows(rows)
assert.Equal(t, NormalizeRows(assertion.Expected), foundRows)
Expand Down
6 changes: 3 additions & 3 deletions testing/logictest/harness/doltgres_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (
// sqllogictest harness for postgres databases.
type PostgresqlServerHarness struct {
dsn string
db *sql.DB
db *sql.DB
}

// compile check for interface compliance
Expand All @@ -49,7 +49,7 @@ func NewPostgresqlHarness(dsn string) *PostgresqlServerHarness {
}
return &PostgresqlServerHarness{
dsn: dsn,
db: db,
db: db,
}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ func (h *PostgresqlServerHarness) ExecuteQuery(statement string) (schema string,
if rows != nil {
defer rows.Close()
}

if err != nil {
return "", nil, err
}
Expand Down

0 comments on commit 887ed96

Please sign in to comment.