From 64940d1494128a0e7982e98d057886143a357dfc Mon Sep 17 00:00:00 2001 From: Nenad Noveljic <18366081+nenadnoveljic@users.noreply.github.com> Date: Wed, 24 Jul 2024 09:13:34 -0400 Subject: [PATCH] [oracle] Fix TestLargeUint64Binding test for RDS (DBMON-4339) (#27893) --- .../oracle/oracle_integration_test.go | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkg/collector/corechecks/oracle/oracle_integration_test.go b/pkg/collector/corechecks/oracle/oracle_integration_test.go index 81a30324a5cea..3c88bd8b094bb 100644 --- a/pkg/collector/corechecks/oracle/oracle_integration_test.go +++ b/pkg/collector/corechecks/oracle/oracle_integration_test.go @@ -356,20 +356,25 @@ func buildConnectionString(connectionConfig config.ConnectionConfig) string { } func TestLargeUint64Binding(t *testing.T) { - largeUint64 := uint64(18446744073709551615) - var result uint64 - var err error - driver := common.GoOra - db, err := connectToDB(driver) - require.NoErrorf(t, err, "connecting to db with %s driver", driver) + c, _ := newDefaultCheck(t, "", "") + require.NoError(t, err) + err = c.Run() + require.NoError(t, err) - err = db.Get(&result, "SELECT n FROM sys.T WHERE n = :1", largeUint64) - assert.NoError(t, err, "running test statement with %s driver", driver) - assert.Equal(t, result, largeUint64, "simple uint64 binding with %s driver", driver) + largeUint64 := uint64(18446744073709551615) + var result uint64 + var owner string + if c.hostingType == rds { + owner = "admin" + } else { + owner = "sys" + } + err = getWrapper(&c, &result, fmt.Sprintf("SELECT n FROM %s.T WHERE n = :1", owner), largeUint64) + require.NoError(t, err, "running test statement") + assert.Equal(t, result, largeUint64, "simple uint64 binded correctly") - err = db.Get(&result, "SELECT 18446744073709551615 FROM dual") - assert.NoError(t, err, "running test statement with %s driver", driver) - assert.Equal(t, result, largeUint64, "result set truncated with %s driver", driver) - db.Close() + err = getWrapper(&c, &result, "SELECT 18446744073709551615 FROM dual") + require.NoError(t, err, "running test statement") + assert.Equal(t, result, largeUint64, "result set not truncated") }