pgconn.CommandTag is now an opaque type
It now makes a copy instead of retaining driver memory. This is in preparation to reuse the driver read buffer.
This commit is contained in:
+4
-4
@@ -45,7 +45,7 @@ func TestConnQueryScan(t *testing.T) {
|
||||
t.Fatalf("conn.Query failed: %v", err)
|
||||
}
|
||||
|
||||
assert.Equal(t, "SELECT 10", string(rows.CommandTag()))
|
||||
assert.Equal(t, "SELECT 10", rows.CommandTag().String())
|
||||
|
||||
if rowCount != 10 {
|
||||
t.Error("Select called onDataRow wrong number of times")
|
||||
@@ -79,7 +79,7 @@ func TestConnQueryWithoutResultSetCommandTag(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
rows.Close()
|
||||
assert.NoError(t, rows.Err())
|
||||
assert.Equal(t, "CREATE TABLE", string(rows.CommandTag()))
|
||||
assert.Equal(t, "CREATE TABLE", rows.CommandTag().String())
|
||||
}
|
||||
|
||||
func TestConnQueryScanWithManyColumns(t *testing.T) {
|
||||
@@ -1139,7 +1139,7 @@ func TestConnQueryDatabaseSQLDriverValuerWithAutoGeneratedPointerReceiver(t *tes
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if string(commandTag) != "INSERT 0 1" {
|
||||
if commandTag.String() != "INSERT 0 1" {
|
||||
t.Fatalf("want %s, got %s", "INSERT 0 1", commandTag)
|
||||
}
|
||||
|
||||
@@ -1976,7 +1976,7 @@ func TestConnQueryFuncAbort(t *testing.T) {
|
||||
},
|
||||
)
|
||||
require.EqualError(t, err, "abort")
|
||||
require.Nil(t, ct)
|
||||
require.Equal(t, pgconn.CommandTag{}, ct)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user