Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlUtil: SQL LENGTH is missing #1395

Closed
alachata-qore opened this issue Nov 10, 2016 · 4 comments
Closed

SqlUtil: SQL LENGTH is missing #1395

alachata-qore opened this issue Nov 10, 2016 · 4 comments

Comments

@alachata-qore
Copy link
Collaborator

SqlUtil misses SQL LENGTH function.

@gamato
Copy link
Contributor

gamato commented Nov 10, 2016

I just figured out this little trick that can be used with current SqlUtil:

Instead of:

where length (col_name) <= 10

one could use:

where substr (col, 10+1) is null

:-)

And there is op_substr() in current version of SqlUtil.

@pvanek
Copy link
Contributor

pvanek commented Nov 10, 2016

actually SqlUtil misses much more than length()... there are tens of standard functions and hundreds specialized functions in different DBMS. I originally suggested something like op_function(string name, ...args...) which would be expanded to (...args...) call, but it was rejected.

@alachata-qore
Copy link
Collaborator Author

I would suggest op_function(string name, ...args...) again..

@davidnich
Copy link
Contributor

@pvanek the reason it was rejected is because it would directly allow SQL injections

davidnich added a commit that referenced this issue Nov 21, 2016
refs #1395 implemented the cop_length() function for SqlUtil
@omusil24 omusil24 added the fixed label Nov 21, 2016
@davidnich davidnich added this to the 0.8.12.4 milestone Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants