Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions testing/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func startServerWithApplication(
func getVersionFromDB(t *testing.T, db *sql.DB) *version.Version {
t.Helper()
var crdbVersion string
if _, err := db.Exec(`SET allow_unsafe_internals=true`); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause issues when this test is executed against older versions of CRDB that don't have this setting.

i wonder if we could just change the select query below to do SHOW crdb_version instead, with some additional parsing.

root@localhost:26257/defaultdb> SELECT value FROM crdb_internal.node_build_info where field = 'Version';
         value
-----------------------
  v25.4.0-alpha.2-dev
(1 row)

Time: 1ms total (execution 1ms / network 0ms)

root@localhost:26257/defaultdb> show crdb_version;
                                         crdb_version
----------------------------------------------------------------------------------------------
  CockroachDB CCL v25.4.0-alpha.2-dev (darwin arm64, built , go1.23.12 X:nocoverageredesign)
(1 row)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great idea, let me see if that works.

t.Fatal(err)
}
if err := db.QueryRow(
`SELECT value FROM crdb_internal.node_build_info where field = 'Version'`,
).Scan(&crdbVersion); err != nil {
Expand Down
Loading