postgresql-interfaces/psqlodbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feed[postgresql-interfaces/psqlodbc] issue #54: Escape sequence for the INSERT function fails.
2+ messages / 1 participants
[nested] [flat]
* [postgresql-interfaces/psqlodbc] issue #54: Escape sequence for the INSERT function fails.
@ 2024-09-27 16:53 "omeuid (@omeuid)" <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: omeuid (@omeuid) @ 2024-09-27 16:53 UTC (permalink / raw)
To: postgresql-interfaces/psqlodbc <[email protected]>
The SQLGetInfo function for the `SQL_STRING_FUNCTIONS` param returns the following information:
`SQL_FN_STR_CONCAT | SQL_FN_STR_INSERT | SQL_FN_STR_LEFT | SQL_FN_STR_LTRIM | SQL_FN_STR_LENGTH | SQL_FN_STR_LOCATE | SQL_FN_STR_LCASE | SQL_FN_STR_REPEAT | SQL_FN_STR_RIGHT | SQL_FN_STR_RTRIM | SQL_FN_STR_SUBSTRING | SQL_FN_STR_UCASE | SQL_FN_STR_ASCII | SQL_FN_STR_CHAR | SQL_FN_STR_LOCATE_2 | SQL_FN_STR_SPACE`
Notice that INSERT function is returned (`SQL_FN_STR_INSERT `).
But when you execute the following escape sequence an error is returned:
* `SELECT {fn INSERT('aabcda', 2, 3 'zzz')}`
The following errors are shown in the driver log:
```
[37872-19.426] execute.c[Exec_with_parameters_resolved]445: copying statement params: trans_status=1, len=40, stmt='SELECT {fn INSERT('aabcda', 2, 3 'zzz')}'
[37872-19.426] convert.c[inner_process_tokens]3912: token_len=6 status=1 token=SELECT
[37872-19.426] convert.c[inner_process_tokens]3912: token_len=1 status=0 token=(
[37872-19.426] convert.c[inner_process_tokens]3912: token_len=1 status=0 token=,
[37872-19.426] convert.c[inner_process_tokens]3912: token_len=1 status=1 token=2
[37872-19.426] convert.c[inner_process_tokens]3912: token_len=1 status=0 token=,
[37872-19.426] convert.c[inner_process_tokens]3912: token_len=1 status=1 token=3
[37872-19.426] convert.c[convert_escape]5861: 4th param not found for the expression substring($1 from 1 for $2 - 1) || $4 || substring($1 from $2 + $3)
[37872-19.426] convert.c[inner_process_tokens]3692: convert_escape error
[37872-19.426]statement.[SC_log_error]2488: STATEMENT ERROR: func=copy_statement_with_parameters, desc='', errnum=1, errmsg='param not found'
```
It seems that the problem could be located in the `inner_process_tokens` or `prepareParametersNoDesc` methods from `convert.c` file.
* Notice that the insert function should be delegated as `(substring($1 from 1 for $2 - 1) || $4 || substring($1 from $2 + $3))` (just like is indicated in convert.c), so the 4th param is included in the expression.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [postgresql-interfaces/psqlodbc] issue #54: Escape sequence for the INSERT function fails.
@ 2024-09-30 15:51 "omeuid (@omeuid)" <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: omeuid (@omeuid) @ 2024-09-30 15:51 UTC (permalink / raw)
To: postgresql-interfaces/psqlodbc <[email protected]>
Closing issue as escape sequence was incorrect.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-09-30 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-27 16:53 [postgresql-interfaces/psqlodbc] issue #54: Escape sequence for the INSERT function fails. "omeuid (@omeuid)" <[email protected]>
2024-09-30 15:51 Re: [postgresql-interfaces/psqlodbc] issue #54: Escape sequence for the INSERT function fails. "omeuid (@omeuid)" <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox