8000 Fix Postgres version string max length. by dimitri · Pull Request #131 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Postgres version string max length. #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/bin/pgcopydb/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ pgsql_commit(PGSQL *pgsql)
typedef struct PgVersionContext
{
char sqlstate[SQLSTATE_LENGTH];
char pgversion[12];
char pgversion[PG_VERSION_STRING_MAX_LENGTH];
int pgversion_num;
bool parsedOk;
} PgVersionContext;
Expand Down
8 changes: 7 additions & 1 deletion src/bin/pgcopydb/pgsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ typedef enum
*/
#define SQLSTATE_LENGTH 6

/*
* That's "x.yy.zz" or "xx.zz" or maybe a debian style version string such as:
* "13.8 (Debian 13.8-1.pgdg110+1)"
*/
#define PG_VERSION_STRING_MAX_LENGTH 45

/* notification processing */
typedef bool (*ProcessNotificationFunction)(int notificationGroupId,
int64_t notificationNodeId,
Expand All @@ -167,7 +173,7 @@ typedef struct PGSQL
PGConnStatus status;
char sqlstate[SQLSTATE_LENGTH];

char pgversion[45]; /* "x.yy.zz" or "xx.zz" or debian style */
char pgversion[PG_VERSION_STRING_MAX_LENGTH];
int pgversion_num;

ProcessNotificationFunction notificationProcessFunction;
Expand Down
0