vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability
https://nebula-graph.io
Apache License 2.0
10.73k stars 1.2k forks source link

When I use parameter to insert vertex, nebula show me an error: -1005:Storage Error: The data type does not meet the requirements. Use the correct type of data. #4375

Open CorvusYe opened 2 years ago

CorvusYe commented 2 years ago

I'm not sure if this is a bug.

What happened?

When I use parameter to insert vertex, nebula show me an error: -1005:Storage Error: The data type does not meet the requirements. Use the correct type of data.

About my env

How To Reproduce

Steps to reproduce the behavior:

  1. Tag of vertex image

  2. Set the parameter in Nebula Studio

    :param name=> 'Test';

    Success

  3. Test the parameter

    return $name

    Output: Test

  4. Insert vertex with parameters

    INSERT VERTEX `person` (
        `name`  
    )
    VALUES "RandowId": (
        $name
    )

    -1005:Storage Error: The data type does not meet the requirements. Use the correct type of data.

Others

When I invoke the method (com.vesoft.nebula.client.graph.net.Session#executeWithParameter), if the parameter is a vertex prop, the error happend too.
Reference other repo of nebula using in java, they use com.vesoft.nebula.client.graph.net.Session#execute to doing their work. For example nebula-jdbc and etc. Maybe it's this problem that stops them. By the way, when we use string splicing to assemble stmt, it may cause a danger that supports nGQL injection I guess.

wey-gu commented 2 years ago

Thanks, this is the requirements on parameter support on dml.