Skip to content

Commit

Permalink
Allow larger column sizes than 8001 in case DB supports it
Browse files Browse the repository at this point in the history
In PostgreSQL, the TEXT field can easily have more than 8001 characters
and it does return the actual number. The size == 0 would happen in case
of some DBs won't return valid value where we would keep the same
behavior as of now.
  • Loading branch information
ignatenkobrain committed Mar 9, 2023
1 parent 2454b14 commit 9757a49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/odbc/c_src/odbcserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ static db_result_msg encode_column_name_list(SQLSMALLINT num_of_columns,
&nullable)))
DO_EXIT(EXIT_DESC);

if(sql_type == SQL_LONGVARCHAR || sql_type == SQL_LONGVARBINARY || sql_type == SQL_WLONGVARCHAR)
if(size == 0 && (sql_type == SQL_LONGVARCHAR || sql_type == SQL_LONGVARBINARY || sql_type == SQL_WLONGVARCHAR))
size = MAXCOLSIZE;

(columns(state)[i]).type.decimal_digits = dec_digits;
Expand Down

0 comments on commit 9757a49

Please sign in to comment.