okbob / plpgsql_check

plpgsql_check is a linter tool (does source code static analyze) for the PostgreSQL language plpgsql (the native language for PostgreSQL store procedures).
https://groups.google.com/forum/#!forum/postgresql-extensions-hacking
Other
641 stars 53 forks source link

expression does not return data (maybe regression after 2.5.4) ? #166

Closed shuehner closed 10 months ago

shuehner commented 10 months ago

Hello,

checking our application with plpgsql-check version 2.6.2 (i.e. on pg12) we get the following error:

error:XX000:9:EXECUTE:expression does not return data

for a pl-function having

Full pl-function can be seen here: https://gist.github.com/shuehner/70e35683bd0a4d552a10596030d64065

I think that maybe a false positive? As after the assignment to the variable in the previous select statement the value of v_SQL i no longer constant '' ?

Note: We did not see this happening with plpsql-check version 2.5.4 so likely related to one of the recent changes in that area.

okbob commented 10 months ago

should be fixed by c0c59b6a2a65c3f54152f4a8b033acd7bfc89d59