orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Case-sensitive commands in console

Open Severogor opened this issue 10 years ago • 7 comments

OrientDB Enterprise 2.1.13.

SELECT out.uid, in.uid from FOLLOWS where out.uid = 1 LIMIT 1

----+------+----------+---------
#   |@CLASS|out       |in
----+------+----------+---------
0   |null  |                 1|                 2
----+------+----------+---------

SELECT out.uid, in.uid from FOLLOWS where out.uid = 1 Limit 100

----+------+----------+----------
#   |@CLASS|out       |in
----+------+----------+----------
0   |null  |                 1|                 2
...
19  |null  |                 1|                 21
----+------+----------+----------
LIMIT EXCEEDED: resultset contains more items not displayed (limit=20)

The same record limit also gives LIMIT -1 etc. As far as I understand, the LIMIT N (writing other than lowercase) gives correct results only in cases when N is in the interval (0, 20). Seems like the LIMIT statement is case-sensitive in console and binary protocol (with pyorient) because it works correctly only in lowercase.

So and quit/exit...

orientdb {db=data}> EXIT

!Unrecognized command: 'EXIT'
orientdb {db=data}> QUIT

!Unrecognized command: 'QUIT'
orientdb {db=data}> exit

May be I misunderstand something and some commands are made case-sensitive?.

Another thing with limit:

orientdb {db=logistics}> select from container LIMIT 0

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #27: Invalid LIMIT value setted to ZERO. Use -1 to ignore the limit or use a positive number. Example: LIMIT 10
Command: SELECT FROM container LIMIT 0
-----------------------------------^

What's the problem with selecting 0 records?.. PostgreSQL 9.4.5

data=# select from container limit 0;
--
(0 rows)

Why do I set as an example PostgreSQL? Because in my (and not only my) practice it is very stable, mature and its developer interface is VERY, VERY convenient. I wish that to OrientDB! Thanks.

Severogor avatar Apr 15 '16 18:04 Severogor

The better suggestion is to explain why a LIMIT 0 might be useful. For instance, it could be a fast method to check the validity of a query.

As for the LIMIT, Limit or limit problem, that needs to be checked.

Scott

smolinari avatar Apr 16 '16 10:04 smolinari

Hi @Severogor

It seems be a matter of wrong pre-parsing in the console application, I'll check it soon

Thanks

Luigi

luigidellaquila avatar Apr 18 '16 09:04 luigidellaquila

Hi, Please check column names also.

orientdb {db=userdata}> SELECT FROM TEST WHERE a is null

0 item(s) found. Query executed in 0.001 sec(s).
orientdb {db=userdata}> SELECT FROM TEST WHERE A is null

----+-----+---------+----+----
#   |@RID |@CLASS   |a   |b   
----+-----+---------+----+----
0   |#58:0|TEST   |1   |x   
----+-----+---------+----+----

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

Thanks. S.

Severogor avatar Apr 19 '16 14:04 Severogor

orientdb {db=userdata}> CREATE EDGE LINK FROM #14:0 TO #29:3 SET ACTION = "Relate";

Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'ACTION.action' is mandatory, but not found on record: LINK#41:-2{ACTION:Relate,out:#14:0,in:#29:3,instructions:[0],process:} v0

orientdb {db=userdata}> CREATE EDGE LINK FROM #14:0 TO #29:3 SET action = "Relate";

Created edge '[LINK#41:2{action:Relate,out:#14:0,in:#29:3,instructions:[0],process:,status:0} v1]' in 0,002000 sec(s).

On Mon, Apr 18, 2016 at 1:56 PM, luigidellaquila [email protected] wrote:

Hi @Severogor https://github.com/Severogor

It seems be a matter of wrong pre-parsing in the console application, I'll check it soon

Thanks

Luigi

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/orientechnologies/orientdb/issues/5993#issuecomment-211304947

Severogor avatar Apr 28 '16 20:04 Severogor

Hi guys,

I just pushed a fix to 2.1.x branch, the fix will be in next 2.1.17

This fix resolves the problems with LIMIT, EXIT, QUIT.

LIMIT 0 was never supported, maybe it will be in the future, but I cannot guarantee it.

Property names are case sensitive in OrientDB, @Severogor this should explain your case

Thanks

Luigi

luigidellaquila avatar May 04 '16 11:05 luigidellaquila

Hello,

Thank you for your fix very much!

Property names are case sensitive in OrientDB, @Severogor https://github.com/Severogor this should explain your case

If so, why does the ALTER block alter properties case-insensitive?

For example, orientdb {db=data}> alter property FOLLOWS.REVISION NOTNULL True Property updated successfully

orientdb {db=data}> alter property FOLLOWS.Revision NOTNULL False Property updated successfully

orientdb {db=data}> ALTER PROPERTY FOLLOWS.revision NOTNULL True Property updated successfully

All these commands change the FOLLOWS.revision NOTNULL property respectively.

Best regards and thanks.

On Wed, May 4, 2016 at 3:15 PM, luigidellaquila [email protected] wrote:

Closed #5993 https://github.com/orientechnologies/orientdb/issues/5993.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/orientechnologies/orientdb/issues/5993#event-650038257

Severogor avatar May 04 '16 20:05 Severogor

That's definitely a bug for me, I'll check it

Thanks

Luigi

luigidellaquila avatar May 05 '16 07:05 luigidellaquila