Skip to content

Commit

Permalink
Merge pull request #324 from vitalca/issue-321
Browse files Browse the repository at this point in the history
Fix importing from Sybase schema (float fields)
  • Loading branch information
GeoffMontee authored Jul 20, 2023
2 parents 96f594d + 93e8a03 commit 2323efe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tds_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3277,7 +3277,10 @@ tdsImportSqlServerSchema(ImportForeignSchemaStmt *stmt, DBPROCESS *dbproc,

/* Floating-point types */
else if (strcmp(data_type, "float") == 0)
appendStringInfo(&buf, " float(%d)", numeric_precision);
if (numeric_precision == 0)
appendStringInfoString(&buf, " float");
else
appendStringInfo(&buf, " float(%d)", numeric_precision);
else if (strcmp(data_type, "real") == 0)
appendStringInfoString(&buf, " real");

Expand Down Expand Up @@ -3659,7 +3662,10 @@ tdsImportSybaseSchema(ImportForeignSchemaStmt *stmt, DBPROCESS *dbproc,

/* Floating-point types */
else if (strcmp(data_type, "float") == 0)
appendStringInfo(&buf, " float(%d)", numeric_precision);
if (numeric_precision == 0)
appendStringInfoString(&buf, " float");
else
appendStringInfo(&buf, " float(%d)", numeric_precision);
else if (strcmp(data_type, "real") == 0)
appendStringInfoString(&buf, " real");

Expand Down

0 comments on commit 2323efe

Please sign in to comment.