Skip to content

Conversation

@angles-n-daemons
Copy link
Contributor

No description provided.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants