question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SELECT value behaviour

See original GitHub issue

Hello, Is this SELECT behaviour correct?

orientdb {db=data}> select 'x'

----+------+----
#   |@CLASS|x   
----+------+----
0   |null  |x   
----+------+----

1 item(s) found. Query executed in 0.001 sec(s).

orientdb {db=data}> select '' 

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.select '' 

Error: java.lang.IllegalArgumentException: Field name is empty 

orientdb {db=data}> select ' ' 

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.select ' ' 

Error: java.lang.IllegalArgumentException: Name is empty 

orientdb {db=data}> select ' x ' 

----+------+---- 
#   |@CLASS| x  
----+------+---- 
0   |null  | x  
----+------+---- 

1 item(s) found. Query executed in 0.001 sec(s). 

I don’t think so… PostgreSQL too.

test=# select '';
 ?column? 
----------

(1 row)

What’s the problem with selecting an empty (though a space isn’t an empty, actually) value?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
luigidellaquilacommented, Apr 19, 2016

Hi @Severogor

+1 for both. For the second one I’m half way to a solution, there is a chance that it will be available as an option in a late 2.2 hotfix (probably not the first GA)

Thanks

Luigi

0reactions
luigidellaquilacommented, Apr 3, 2017

That should never happen for valid expressions, they always have valid names, but if you find a case where it happens please let me know, I just have to add a default alias. The problem with default aliases is that they can collide with schemaless document properties…

In v. 3.0 I managed this problem in a natural way, the default alias for an expression is just the expression itself as a string, eg. the default alias for l-i-1 is just `l - i - 1`

Thanks

Luigi

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set Behaviour Multi and Single Select Options and Value
Use this script to restrict the options available, and set the default value of single or multi-select fields on the Create or Update...
Read more >
Scriptrunner behaviour - Setting select list options 'None' is not ...
I am setting up a behaviour in Scriptrunner and for the most part have everything working what isn't working is the setting of...
Read more >
<select>: The HTML Select element - HTML - MDN Web Docs
Each <option> element should have a value attribute containing the data value to submit to the server when that option is selected.
Read more >
Behavior of val() for multiple select in jQuery changed?
The val function gets the value of the first element in the set of matched elements. To get the value of multiple selected...
Read more >
Default Dropdown Behaviour - Vue Select
The dropdownShouldOpen prop allows for full customization of the open/close behaviour. The prop accepts a function that should return a boolean value.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found