Skip to content

Commit

Permalink
add DBD::mysql::client_version() to have the client version without D…
Browse files Browse the repository at this point in the history
…B connections
  • Loading branch information
gfx authored and dveeden committed Oct 6, 2023
1 parent 60705e2 commit b77582d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbdimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ signed_my_ulonglong2str(my_ulonglong val, char *buf, STRLEN *len)
}
#endif

static SV*
SV*
my_ulonglong2sv(pTHX_ my_ulonglong val)
{
#if IVSIZE >= 8
Expand Down
2 changes: 2 additions & 0 deletions dbdimp.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,5 @@ int mysql_st_free_result_sets (SV * sth, imp_sth_t * imp_sth);
int mysql_db_async_result(SV* h, MYSQL_RES** resp);
int mysql_db_async_ready(SV* h);
int mysql_socket_ready(my_socket fd);

SV* my_ulonglong2sv(pTHX_ my_ulonglong val);
6 changes: 6 additions & 0 deletions mysql.xs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ constant(name, arg)
OUTPUT:
RETVAL

SV*
client_version(pkg)
CODE:
RETVAL = my_ulonglong2sv(aTHX_ mysql_get_client_version());
OUTPUT:
RETVAL

MODULE = DBD::mysql PACKAGE = DBD::mysql::dr

Expand Down
3 changes: 3 additions & 0 deletions t/version.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ is(
'VERSION strings should be the same in all .pm files in dist'
);

diag("mysql_get_client_version: ", DBD::mysql->client_version);
cmp_ok(DBD::mysql->client_version, ">", 0, "mysql_get_client_version is available as a standalone function");

done_testing;

0 comments on commit b77582d

Please sign in to comment.