fix(oracle): reduce view query page round trips

This commit is contained in:
t8y2 committed 2026-09-10 00:00:06 +08:00
1 parent 7b0ea38bbf
commit 1663f3633f
2 files changed
+33 -1

No files matched your search

+21
View File
@@ -1183,6 +1183,27 @@ func TestBuildDSNUsesStableDefaultPrefetchRows(t *testing.T) {
}
}
func TestReadQuerySessionPageDoesNotLookAheadAfterFullPage(t *testing.T) {
db, _ := openOracleViewSourceTestDB(t, []oracleViewSourceQueryStep{{
queryContains: "SELECT * FROM TEST_VIEW",
args: []driver.Value{},
columns: []string{"ID"},
rows: [][]driver.Value{{int64(1)}, {int64(2)}},
}})
s := newServer()
s.db = db
result, err := s.executeQueryPage(queryOptions{SQL: "SELECT * FROM TEST_VIEW"}, 2)
if err != nil {
t.Fatal(err)
}
if len(result.Rows) != 2 || !result.HasMore || result.SessionID == nil {
t.Fatalf("full page should keep a lazy session without look-ahead: %+v", result)
}
if !s.closeQuerySession(*result.SessionID) {
t.Fatal("expected the query session to close")
}
}
func TestBuildDSNPreservesConfiguredPrefetchRows(t *testing.T) {
tests := []connectParams{
{