Hi
I am doing some tests and found that when using a query with the convert function like
SELECT SUM({fn CONVERT(1, SQL_BIGINT)})
It gets translated to
SELECT SUM('1')
Which fails due to the aggregation function receiving a text literal instead of a number.
I have narrowed down to this line in convert.c (https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=convert.c;h=d94fdb685df0a3430a13650f5140bb3bbb1d6272;hb=HEAD#l5744) deciding to add the quotes:
5743 else if (isdigit((unsigned char) *pptr))
5744 add_quote = TRUE;
How expected is that convert function to produce a text literal which makes the query to fail?
The simpliest way to reproduce it I found is with a python script using a DSN called PostgreSQL35W (tested with version 13.02.0000):
Best regards,
Jacobo
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера