Skip to content

Commit

Permalink
ct_con_props: Support getting CS_PRODUCT_NAME.
Browse files Browse the repository at this point in the history
Sybase/SAP ctlib has no such property, so use the next available 93xx
numeric value.

Signed-off-by: Aaron M. Ucko <[email protected]>
  • Loading branch information
ucko authored and freddy77 committed Dec 20, 2024
1 parent 870fb09 commit 695e724
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/cspublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ enum
#define CS_CLIENTCHARSET CS_CLIENTCHARSET
CS_DATABASE = 9302,
#define CS_DATABASE CS_DATABASE
CS_NOTE_EMPTY_DATA = 9303
CS_NOTE_EMPTY_DATA = 9303,
#define CS_NOTE_EMPTY_DATA CS_NOTE_EMPTY_DATA
CS_PRODUCT_NAME = 9304
#define CS_PRODUCT_NAME CS_PRODUCT_NAME
};

/* Arbitrary precision math operators */
Expand Down
7 changes: 7 additions & 0 deletions src/ctlib/ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,13 @@ ct_con_props(CS_CONNECTION * con, CS_INT action, CS_INT property, CS_VOID * buff
*out_len = tds_dstr_len(s);
strlcpy((char *) buffer, tds_dstr_cstr(s), buflen);
break;
case CS_PRODUCT_NAME:
if (out_len)
*out_len = (CS_INT) strlen
(tds->conn->product_name);
strlcpy((char *) buffer, tds->conn->product_name,
buflen);
break;
case CS_LOC_PROP:
if (buflen != CS_UNUSED || !con->locale || !buffer)
return CS_FAIL;
Expand Down

0 comments on commit 695e724

Please sign in to comment.